rebase -i: handle fixup of root commit correctly
authorChris Webb <chris@arachsys.com>
Tue, 24 Jul 2012 12:17:03 +0000 (13:17 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 Jul 2012 16:03:33 +0000 (09:03 -0700)
There is a bug with git rebase -i --root when a fixup or squash line is
applied to the new root. We attempt to amend the commit onto which they
apply with git reset --soft HEAD^ followed by a normal commit. Unlike a
real commit --amend, this sequence will fail against a root commit as it
has no parent.

Fix rebase -i to use commit --amend for fixup and squash instead, and
add a test for the case of a fixup of the root commit.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found