Fix unit tests for windows by explicitly closing test repos

Change-Id: If5f67d739f744f19b45e6f5c7597a213fd5bf025
This commit is contained in:
Christian Halstrick 2014-12-22 10:13:41 +01:00
parent 75272ccdfc
commit d49c9ee848
1 changed files with 3 additions and 0 deletions

View File

@ -146,6 +146,7 @@ public void testCloneRepositoryExplicitGitDir() throws IOException,
command.setGitDir(new File(directory, ".git"));
command.setURI(fileUri());
Git git2 = command.call();
addRepoToClose(git2.getRepository());
assertEquals(directory, git2.getRepository().getWorkTree());
assertEquals(new File(directory, ".git"), git2.getRepository()
.getDirectory());
@ -161,6 +162,7 @@ public void testCloneRepositoryExplicitGitDirNonStd() throws IOException,
command.setGitDir(gDir);
command.setURI(fileUri());
Git git2 = command.call();
addRepoToClose(git2.getRepository());
assertEquals(directory, git2.getRepository().getWorkTree());
assertEquals(gDir, git2.getRepository()
.getDirectory());
@ -177,6 +179,7 @@ public void testCloneRepositoryExplicitGitDirBare() throws IOException,
command.setGitDir(gDir);
command.setURI(fileUri());
Git git2 = command.call();
addRepoToClose(git2.getRepository());
try {
assertNull(null, git2.getRepository().getWorkTree());
fail("Expected NoWorkTreeException");