Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] CommitCommand amend and parent order

CommitCommand contains following code:

if (amend) {
	RevCommit previousCommit = new RevWalk(repo)
			.parseCommit(headId);
	RevCommit[] p = previousCommit.getParents();
	for (int i = 0; i < p.length; i++)
		parents.add(0, p[i].getId());
	if (author == null)
		author = previousCommit.getAuthorIdent();
}

Here the parents are inserted in reverse order:

parents.add(0, p[i].getId());

This looks like intention, but is still wrong, IMO.

-Marc


Back to the top