Browse Source

DirCacheBasicTest: Open ObjectInserter.Formatter in try-with-resource

Change-Id: Ie4b3e5ad9616bc56b6d8d2476d1e6c6319c1a0aa
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
stable-4.2
David Pursehouse 9 years ago
parent
commit
c9e61c7b39
  1. 8
      org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java

8
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java vendored

@ -255,9 +255,11 @@ public class DirCacheBasicTest extends RepositoryTestCase {
DirCacheBuilder b = dc.builder();
DirCacheEntry e = new DirCacheEntry(path);
e.setFileMode(FileMode.REGULAR_FILE);
e.setObjectId(new ObjectInserter.Formatter().idFor(
Constants.OBJ_BLOB,
Constants.encode(path)));
try (ObjectInserter.Formatter formatter = new ObjectInserter.Formatter()) {
e.setObjectId(formatter.idFor(
Constants.OBJ_BLOB,
Constants.encode(path)));
}
b.add(e);
b.commit();
db.readDirCache();

Loading…
Cancel
Save