| | |
| | | import org.eclipse.jgit.lib.RepositoryCache.FileKey;
|
| | | import org.eclipse.jgit.revwalk.RevCommit;
|
| | | import org.eclipse.jgit.util.FS;
|
| | | import org.eclipse.jgit.util.FileUtils;
|
| | |
|
| | | import com.gitblit.GitBlit;
|
| | | import com.gitblit.Keys;
|
| | |
| | | }
|
| | |
|
| | | public void testLastCommit() throws Exception {
|
| | | assertTrue(JGitUtils.getLastChange(null).equals(new Date(0)));
|
| | | assertTrue(JGitUtils.getLastChange(null, null).equals(new Date(0)));
|
| | |
|
| | | Repository repository = GitBlitSuite.getHelloworldRepository();
|
| | | assertTrue(JGitUtils.getCommit(repository, null) != null);
|
| | | Date date = JGitUtils.getLastChange(repository);
|
| | | Date date = JGitUtils.getLastChange(repository, null);
|
| | | repository.close();
|
| | | assertTrue("Could not get last repository change date!", date != null);
|
| | | }
|
| | |
| | | assertTrue(JGitUtils.getFirstCommit(repository, null) == null);
|
| | | assertTrue(JGitUtils.getFirstChange(repository, null).getTime() == folder
|
| | | .lastModified());
|
| | | assertTrue(JGitUtils.getLastChange(repository).getTime() == folder.lastModified());
|
| | | assertTrue(JGitUtils.getLastChange(repository, null).getTime() == folder.lastModified());
|
| | | assertTrue(JGitUtils.getCommit(repository, null) == null);
|
| | | repository.close();
|
| | | assertTrue(GitBlit.self().deleteRepository(repositoryName));
|
| | |
| | | assertTrue(list.size() > 0);
|
| | | assertTrue(list.get(0).notesRef.getReferencedObjectId().getName()
|
| | | .equals("183474d554e6f68478a02d9d7888b67a9338cdff"));
|
| | | }
|
| | |
|
| | | public void testCreateOrphanedBranch() throws Exception {
|
| | | Repository repository = JGitUtils.createRepository(GitBlitSuite.REPOSITORIES, "orphantest");
|
| | | assertTrue(JGitUtils.createOrphanBranch(repository,
|
| | | "x" + Long.toHexString(System.currentTimeMillis()).toUpperCase()));
|
| | | FileUtils.delete(repository.getDirectory(), FileUtils.RECURSIVE);
|
| | | }
|
| | |
|
| | | public void testStringContent() throws Exception {
|
| | |
| | | assertTrue(zipFileB.length() > 0);
|
| | | zipFileB.delete();
|
| | | }
|
| | |
|
| | | } |