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