public void testMoveMergeCommit () throws Exception { File f = new File(workDir, "f"); write(f, "init"); add(f); commit(f); write(f, "modif"); add(f); commit(f); GitClient client = getClient(workDir); GitRevisionInfo info = client.log("HEAD", NULL_PROGRESS_MONITOR); client.reset("HEAD~1", GitClient.ResetType.HARD, NULL_PROGRESS_MONITOR); GitRefUpdateResult res = client.updateReference("master", info.getRevision(), NULL_PROGRESS_MONITOR); assertEquals(GitRefUpdateResult.FAST_FORWARD, res); ReflogReader reflogReader = repository.getReflogReader("master"); assertEquals("merge " + info.getRevision() + ": Fast-forward", reflogReader.getLastEntry().getComment()); }
public void testMoveMergeRef () throws Exception { File f = new File(workDir, "f"); write(f, "init"); add(f); commit(f); write(f, "modif"); add(f); commit(f); GitClient client = getClient(workDir); client.createBranch("BRANCH", "HEAD", NULL_PROGRESS_MONITOR); client.reset("HEAD~1", GitClient.ResetType.HARD, NULL_PROGRESS_MONITOR); GitRefUpdateResult res = client.updateReference("master", "BRANCH", NULL_PROGRESS_MONITOR); assertEquals(GitRefUpdateResult.FAST_FORWARD, res); ReflogReader reflogReader = repository.getReflogReader("master"); assertEquals("merge BRANCH: Fast-forward", reflogReader.getLastEntry().getComment()); }
public List<ReflogEntry> getReflogEntries() throws IOException { Repository repo = gitRepository.getRepository(); ReflogReader reflogReader = repo.getReflogReader(getName()); List<ReflogEntry> reverseEntries = reflogReader.getReverseEntries(); return reverseEntries; }