only parse parent commit if present

This commit is contained in:
Braydon 2023-08-06 00:20:12 -04:00
parent 9916cb7264
commit eca1d69ed2

View File

@ -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:");