am --abort: support aborting to unborn branch
commite06764c8ebf87a80737dc0a6198a013799f18e32
authorPaul Tan <pyokagan@gmail.com>
Sat, 6 Jun 2015 11:46:11 +0000 (6 19:46 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Jun 2015 20:10:45 +0000 (8 13:10 -0700)
tree88a26db295be4d1b2d97fabb50105ad046aa67a2
parent20c3fe762105a29150fd21e3e0a340bca7890848
am --abort: support aborting to unborn branch

When git-am is first run on an unborn branch, no ORIG_HEAD is created.
As such, any applied commits will remain even after a git am --abort.

To be consistent with the behavior of git am --abort when it is not run
from an unborn branch, we empty the index, and then destroy the branch
pointed to by HEAD if there is no ORIG_HEAD.

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-am.sh
t/t4151-am-abort.sh