LockFileTest: Open Git instance in try-with-resource
Change-Id: Ie2b0e55e606f50c46e21227f23de74dbea8388e5 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
This commit is contained in:
parent
3a6ed050a4
commit
6d33322df4
|
@ -61,7 +61,7 @@ public class LockFileTest extends RepositoryTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void lockFailedExceptionRecovery() throws Exception {
|
public void lockFailedExceptionRecovery() throws Exception {
|
||||||
Git git = new Git(db);
|
try (Git git = new Git(db)) {
|
||||||
writeTrashFile("file.txt", "content");
|
writeTrashFile("file.txt", "content");
|
||||||
git.add().addFilepattern("file.txt").call();
|
git.add().addFilepattern("file.txt").call();
|
||||||
RevCommit commit1 = git.commit().setMessage("create file").call();
|
RevCommit commit1 = git.commit().setMessage("create file").call();
|
||||||
|
@ -82,4 +82,5 @@ public void lockFailedExceptionRecovery() throws Exception {
|
||||||
git.checkout().setName(commit1.name()).call();
|
git.checkout().setName(commit1.name()).call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue