Fix CommitCommand amend mode to preserve parent order
Change-Id: I476921ff8dfa6a357932d42ee59340873502b582
This commit is contained in:
parent
d9d3439617
commit
1f51aecf95
|
@ -184,9 +184,8 @@ public RevCommit call() throws GitAPIException, NoHeadException,
|
||||||
if (amend) {
|
if (amend) {
|
||||||
RevCommit previousCommit = new RevWalk(repo)
|
RevCommit previousCommit = new RevWalk(repo)
|
||||||
.parseCommit(headId);
|
.parseCommit(headId);
|
||||||
RevCommit[] p = previousCommit.getParents();
|
for (RevCommit p : previousCommit.getParents())
|
||||||
for (int i = 0; i < p.length; i++)
|
parents.add(p.getId());
|
||||||
parents.add(0, p[i].getId());
|
|
||||||
if (author == null)
|
if (author == null)
|
||||||
author = previousCommit.getAuthorIdent();
|
author = previousCommit.getAuthorIdent();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue