|
|
@ -754,13 +754,11 @@ public class SubmoduleWalk implements AutoCloseable { |
|
|
|
* @throws java.io.IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public ObjectId getHead() throws IOException { |
|
|
|
public ObjectId getHead() throws IOException { |
|
|
|
Repository subRepo = getRepository(); |
|
|
|
try (Repository subRepo = getRepository()) { |
|
|
|
if (subRepo == null) |
|
|
|
if (subRepo == null) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
try { |
|
|
|
} |
|
|
|
return subRepo.resolve(Constants.HEAD); |
|
|
|
return subRepo.resolve(Constants.HEAD); |
|
|
|
} finally { |
|
|
|
|
|
|
|
subRepo.close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -771,14 +769,12 @@ public class SubmoduleWalk implements AutoCloseable { |
|
|
|
* @throws java.io.IOException |
|
|
|
* @throws java.io.IOException |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public String getHeadRef() throws IOException { |
|
|
|
public String getHeadRef() throws IOException { |
|
|
|
Repository subRepo = getRepository(); |
|
|
|
try (Repository subRepo = getRepository()) { |
|
|
|
if (subRepo == null) |
|
|
|
if (subRepo == null) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
try { |
|
|
|
} |
|
|
|
Ref head = subRepo.exactRef(Constants.HEAD); |
|
|
|
Ref head = subRepo.exactRef(Constants.HEAD); |
|
|
|
return head != null ? head.getLeaf().getName() : null; |
|
|
|
return head != null ? head.getLeaf().getName() : null; |
|
|
|
} finally { |
|
|
|
|
|
|
|
subRepo.close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|