Skip to content

Commit

Permalink
Extract SHA from index if the head is null
Browse files Browse the repository at this point in the history
  • Loading branch information
dabico committed Jul 26, 2024
1 parent 6a2158e commit d316538
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ private void status(String parent, Git git) throws GitAPIException, IOException
for (SubmoduleStatus status : statuses) {
String path = status.getPath();
ObjectId head = status.getHeadId();
String sha = head.getName();
ObjectId index = status.getIndexId();
String sha = head != null ? head.getName() : index.getName();
SubmoduleStatusType type = status.getType();
try (Repository submodule = SubmoduleWalk.getSubmoduleRepository(repository, path)) {
Path relative = Paths.get(parent, path);
Expand Down

0 comments on commit d316538

Please sign in to comment.