only parse parent commit if present
This commit is contained in:
parent
9916cb7264
commit
eca1d69ed2
@ -70,7 +70,9 @@ public final class GitUtils {
|
||||
return new AbstractMap.SimpleEntry<>(latestCommit.getName(), commitsSinceLastTag);
|
||||
}
|
||||
commitsSinceLastTag++; // Increment commits since last tag
|
||||
commit = walk.parseCommit(commit.getParent(0)); // Get the parent commit
|
||||
if (commit.getParentCount() > 0) { // Get the parent commit
|
||||
commit = walk.parseCommit(commit.getParent(0));
|
||||
}
|
||||
}
|
||||
} catch (IOException | GitAPIException ex) {
|
||||
System.err.println("Failed fetching git data:");
|
||||
|
Loading…
x
Reference in New Issue
Block a user