import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.util.FileUtils;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
addRepoToClose(bareRepo);
}
- @Override
- @After
- public void tearDown() throws Exception {
- db.close();
- bareRepo.close();
- super.tearDown();
- }
-
@Test
public void testWrap() throws JGitInternalException, GitAPIException {
Git git = Git.wrap(db);
public void testClose() throws IOException, JGitInternalException,
GitAPIException {
File workTree = db.getWorkTree();
- db.close();
Git git = Git.open(workTree);
git.gc().setExpire(null).call();
git.checkout().setName(git.getRepository().resolve("HEAD^").getName())