CommitCommand: Open InputStream in try-with-resource
Change-Id: I800a2afae17f84636cae593be7f07628fb8476c1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
1826341793
commit
3393f78210
|
@ -409,14 +409,11 @@ private DirCache createTemporaryIndex(ObjectId headId, DirCache index,
|
|||
inserter = repo.newObjectInserter();
|
||||
long contentLength = fTree
|
||||
.getEntryContentLength();
|
||||
InputStream inputStream = fTree
|
||||
.openEntryStream();
|
||||
try {
|
||||
try (InputStream inputStream = fTree
|
||||
.openEntryStream()) {
|
||||
dcEntry.setObjectId(inserter.insert(
|
||||
Constants.OBJ_BLOB, contentLength,
|
||||
inputStream));
|
||||
} finally {
|
||||
inputStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue