IndexModificationTimesTest: Open Git instances in try-with-resource

Change-Id: If52c071b71f5df822b1ac276a6f665515f6c9d00
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
This commit is contained in:
David Pursehouse 2016-02-15 14:51:42 +09:00
parent de73fbf597
commit 217760fee5
1 changed files with 52 additions and 51 deletions

View File

@ -49,7 +49,7 @@ public class IndexModificationTimesTest extends RepositoryTestCase {
@Test
public void testLastModifiedTimes() throws Exception {
Git git = new Git(db);
try (Git git = new Git(db)) {
String path = "file";
writeTrashFile(path, "content");
String path2 = "file2";
@ -83,10 +83,11 @@ public void testLastModifiedTimes() throws Exception {
assertTrue("last modified shall not be zero!",
entry2.getLastModified() != 0);
}
}
@Test
public void testModify() throws Exception {
Git git = new Git(db);
try (Git git = new Git(db)) {
String path = "file";
writeTrashFile(path, "content");
@ -122,7 +123,7 @@ public void testModify() throws Exception {
assertTrue("shall have equal mod time!", masterLastMod == sideLastMode);
assertTrue("shall not equal master timestamp!",
entry.getLastModified() == masterLastMod);
}
}
}