import org.eclipse.jgit.api.ReflogCommand;\r
import org.eclipse.jgit.internal.storage.file.ReflogEntry;\r
import org.eclipse.jgit.lib.Constants;\r
-import org.eclipse.jgit.lib.ObjectId;\r
import org.eclipse.jgit.lib.Repository;\r
import org.kohsuke.args4j.Argument;\r
\r
s.append(ref == null ? Constants.HEAD : Repository.shortenRefName(ref));\r
s.append("@{" + i + "}:"); //$NON-NLS-1$ //$NON-NLS-2$\r
s.append(" "); //$NON-NLS-1$\r
- // temporary workaround for bug 393463\r
- if (entry.getOldId().equals(ObjectId.zeroId()))\r
- s.append(entry.getComment().replaceFirst("^commit:", //$NON-NLS-1$\r
- "commit (initial):")); //$NON-NLS-1$\r
- else\r
- s.append(entry.getComment());\r
+ s.append(entry.getComment());\r
return s.toString();\r
}\r
}\r
MergeResult result = git.merge().include(db.getRef(Constants.HEAD)).call();
assertEquals(MergeResult.MergeStatus.ALREADY_UP_TO_DATE, result.getMergeStatus());
// no reflog entry written by merge
- assertEquals("commit: initial commit",
+ assertEquals("commit (initial): initial commit",
db
.getReflogReader(Constants.HEAD).getLastEntry().getComment());
- assertEquals("commit: initial commit",
+ assertEquals("commit (initial): initial commit",
db
.getReflogReader(db.getBranch()).getLastEntry().getComment());
}
assertNotNull(reflog);
assertEquals(3, reflog.size());
ReflogEntry[] reflogs = reflog.toArray(new ReflogEntry[reflog.size()]);
- assertEquals(reflogs[2].getComment(), "commit: Initial commit");
+ assertEquals(reflogs[2].getComment(),
+ "commit (initial): Initial commit");
assertEquals(reflogs[2].getNewId(), commit1.getId());
assertEquals(reflogs[2].getOldId(), ObjectId.zeroId());
assertEquals(reflogs[1].getComment(),
assertNotNull(reflog);
assertEquals(4, reflog.size());
ReflogEntry[] reflogs = reflog.toArray(new ReflogEntry[reflog.size()]);
- assertEquals(reflogs[3].getComment(), "commit: Initial commit");
+ assertEquals(reflogs[3].getComment(),
+ "commit (initial): Initial commit");
assertEquals(reflogs[3].getNewId(), commit1.getId());
assertEquals(reflogs[3].getOldId(), ObjectId.zeroId());
assertEquals(reflogs[2].getComment(),
ru.setRefLogMessage(reflogComment, false);
} else {
String prefix = amend ? "commit (amend): " //$NON-NLS-1$
- : "commit: ";
+ : parents.size() == 0 ? "commit (initial): "
+ : "commit: ";
ru.setRefLogMessage(
prefix + revCommit.getShortMessage(), false);
}