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)
	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.


Back to the top