RefTreeBatch: fix unclosed resource warning
Change-Id: I7d630d11d3ef2ff2b74ec7a7018760b7b4931ad2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
7ae3507998
commit
c845db3ec2
|
@ -88,8 +88,9 @@ void init(RevWalk rw) throws IOException {
|
|||
tree = RefTree.read(rw.getObjectReader(), c.getTree());
|
||||
} else {
|
||||
parentCommitId = ObjectId.zeroId();
|
||||
parentTreeId = new ObjectInserter.Formatter()
|
||||
.idFor(OBJ_TREE, new byte[] {});
|
||||
try (ObjectInserter.Formatter fmt = new ObjectInserter.Formatter()) {
|
||||
parentTreeId = fmt.idFor(OBJ_TREE, new byte[] {});
|
||||
}
|
||||
tree = RefTree.newEmptyTree();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue