CommitCommand: Open InputStream in try-with-resource

Change-Id: I800a2afae17f84636cae593be7f07628fb8476c1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2018-03-06 09:48:19 +09:00
parent 1826341793
commit 3393f78210
1 changed files with 2 additions and 5 deletions

View File

@ -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();
}
}
}