Skip to main content

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

On Thu, Mar 28, 2013 at 1:21 PM, Marc Strapetz
<marc.strapetz@xxxxxxxxxxx> wrote:
> 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.

I think you are right. https://git.eclipse.org/r/11553


Back to the top