Merge "Ensure that RevWalk in SubmoduleOp is released"
This commit is contained in:
@@ -365,7 +365,7 @@ public class SubmoduleOp {
|
||||
private static DirCache readTree(final Repository pdb, final Ref branch)
|
||||
throws MissingObjectException, IncorrectObjectTypeException, IOException {
|
||||
final RevWalk rw = new RevWalk(pdb);
|
||||
|
||||
try {
|
||||
final DirCache dc = DirCache.newInCore();
|
||||
final DirCacheBuilder b = dc.builder();
|
||||
b.addTree(new byte[0], // no prefix path
|
||||
@@ -373,6 +373,9 @@ public class SubmoduleOp {
|
||||
pdb.newObjectReader(), rw.parseTree(branch.getObjectId()));
|
||||
b.finish();
|
||||
return dc;
|
||||
} finally {
|
||||
rw.release();
|
||||
}
|
||||
}
|
||||
|
||||
private static void logAndThrowSubmoduleException(final String errorMsg,
|
||||
|
||||
Reference in New Issue
Block a user