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();
|
inserter = repo.newObjectInserter();
|
||||||
long contentLength = fTree
|
long contentLength = fTree
|
||||||
.getEntryContentLength();
|
.getEntryContentLength();
|
||||||
InputStream inputStream = fTree
|
try (InputStream inputStream = fTree
|
||||||
.openEntryStream();
|
.openEntryStream()) {
|
||||||
try {
|
|
||||||
dcEntry.setObjectId(inserter.insert(
|
dcEntry.setObjectId(inserter.insert(
|
||||||
Constants.OBJ_BLOB, contentLength,
|
Constants.OBJ_BLOB, contentLength,
|
||||||
inputStream));
|
inputStream));
|
||||||
} finally {
|
|
||||||
inputStream.close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue