| | |
| | | import java.io.IOException;
|
| | | import java.util.List;
|
| | |
|
| | | import org.eclipse.jgit.storage.file.FileRepository;
|
| | | import org.eclipse.jgit.lib.Repository;
|
| | | import org.eclipse.jgit.lib.RepositoryCache.FileKey;
|
| | | import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
|
| | | import org.eclipse.jgit.util.FS;
|
| | | import org.junit.Test;
|
| | |
|
| | | import com.gitblit.models.PushLogEntry;
|
| | | import com.gitblit.utils.PushLogUtils;
|
| | | import com.gitblit.models.RefLogEntry;
|
| | | import com.gitblit.utils.RefLogUtils;
|
| | |
|
| | | public class PushLogTest {
|
| | |
|
| | | @Test
|
| | | public void testPushLog() throws IOException {
|
| | | String name = "~james/helloworld.git";
|
| | | FileRepository repository = new FileRepository(new File(GitBlitSuite.REPOSITORIES, name));
|
| | | List<PushLogEntry> pushes = PushLogUtils.getPushLog(name, repository);
|
| | | File gitDir = FileKey.resolve(new File(GitBlitSuite.REPOSITORIES, name), FS.DETECTED);
|
| | | Repository repository = new FileRepositoryBuilder().setGitDir(gitDir).build();
|
| | | List<RefLogEntry> pushes = RefLogUtils.getRefLog(name, repository);
|
| | | GitBlitSuite.close(repository);
|
| | | }
|
| | | } |