From b6962a7486d33505bda487c887ceb8a79ef47927 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Thu, 25 Apr 2024 13:37:05 +0200 Subject: [PATCH] Some debug --- gcl.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gcl.java b/gcl.java index dbec836..5b9313e 100755 --- a/gcl.java +++ b/gcl.java @@ -179,15 +179,24 @@ public Integer call() throws Exception { Git git = Git.open(repositoryPath.toFile()); Repository repository = git.getRepository(); RevWalk revWalk = new RevWalk(repository)) { + String remoteOriginUrl = "n/a"; if (!hasRepository) { // Source: https://stackoverflow.com/a/38062680/873282 - ownerRepository = git.getRepository().getConfig().getString("remote", "origin", "url"); - ownerRepository = ownerRepository.substring(ownerRepository.indexOf(':') + 1, ownerRepository.lastIndexOf('.')); + remoteOriginUrl = git.getRepository().getConfig().getString("remote", "origin", "url"); + ownerRepository = remoteOriginUrl.substring(remoteOriginUrl.indexOf(':') + 1, remoteOriginUrl.lastIndexOf('.')); } Logger.info("Connecting to {}...", ownerRepository); GitHub gitHub = GitHub.connect(); - GHRepository gitHubRepository = gitHub.getRepository(ownerRepository); + try { + GHRepository gitHubRepository = gitHub.getRepository(ownerRepository); + } catch (IllegalArgumentException e) { + Logger.error("Error in repository reference {}", ownerRepository); + if (!hasRepository) { + Logger.error("It was automatically derived from {}", remoteOriginUrl); + } + return 1; + } MVMap emailToContributor = store.openMap("emailToContributor"); MVMap loginToContributor = store.openMap("loginToContributor");