use jgit java7 support, to improve git performance

This commit is contained in:
Sebastian Sdorra
2014-08-15 22:21:07 +02:00
parent c5399823a7
commit 3abbff2317
5 changed files with 46 additions and 15 deletions

View File

@@ -30,11 +30,21 @@
*/
package sonia.scm.repository;
//~--- non-JDK imports --------------------------------------------------------
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
@@ -81,6 +91,25 @@ public class GitUtilTest
GitUtil.checkBranchName(repo, GitUtil.REF_HEAD_PREFIX.concat("develop"));
}
/**
* Method description
*
*
* @throws GitAPIException
* @throws IOException
*/
@Test
public void testOpenJava7() throws GitAPIException, IOException
{
File dir = temp.newFolder();
Git.init().setDirectory(dir).setBare(true).call();
org.eclipse.jgit.lib.Repository repo = GitUtil.open(dir);
assertThat(repo.getFS().getClass().getName(), containsString("Java7"));
}
/**
* Method description
*
@@ -98,4 +127,10 @@ public class GitUtilTest
return repo;
}
//~--- fields ---------------------------------------------------------------
/** Field description */
@Rule
public TemporaryFolder temp = new TemporaryFolder();
}