Skip to content

Commit

Permalink
[Fix JENKINS-30589] - getRemoteReferences return empty map
Browse files Browse the repository at this point in the history
JGit correctly returns an empty map when remote references are not
found, while CliGitAPIImpl threw an exception, now returns empty map.
  • Loading branch information
MarkEWaite committed Nov 17, 2017
1 parent a59623c commit 1e1f8ff
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -2807,7 +2807,9 @@ public Map<String, ObjectId> getRemoteReferences(String url, String pattern, boo
Map<String, ObjectId> references = new HashMap<>();
String[] lines = result.split("\n");
for (String line : lines) {
if (line.length() < 41) throw new GitException("unexpected ls-remote output " + line);
if (line.length() < 41) {
continue; // throw new GitException("unexpected ls-remote output " + line);
}
String refName = line.substring(41);
ObjectId refObjectId = ObjectId.fromString(line.substring(0, 40));
if (refName.startsWith("refs/tags") && refName.endsWith("^{}")) {
Expand Down

0 comments on commit 1e1f8ff

Please sign in to comment.