Code

commit, merge: initialize static strbuf
[git.git] / git-am.sh
index 9bf12feeb261a9c64568600ef33301e1585f57bb..f4abd9db15d7e7213e0d94a6c36e5205b7c5e0ce 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -44,7 +44,7 @@ stop_here_user_resolve () {
            printf '%s\n' "$resolvemsg"
            stop_here $1
     fi
-    cmdline=$(basename $0)
+    cmdline="git am"
     if test '' != "$interactive"
     then
         cmdline="$cmdline -i"
@@ -202,8 +202,15 @@ then
        die "previous rebase directory $dotest still exists but mbox given."
        resume=yes
 
-       case "$abort" in
-       t)
+       case "$skip,$abort" in
+       t,)
+               git rerere clear
+               git read-tree --reset -u HEAD HEAD
+               orig_head=$(cat "$GIT_DIR/ORIG_HEAD")
+               git reset HEAD
+               git update-ref ORIG_HEAD $orig_head
+               ;;
+       ,t)
                git rerere clear
                git read-tree --reset -u HEAD ORIG_HEAD
                git reset ORIG_HEAD
@@ -297,7 +304,6 @@ last=`cat "$dotest/last"`
 this=`cat "$dotest/next"`
 if test "$skip" = t
 then
-       git rerere clear
        this=`expr "$this" + 1`
        resume=
 fi
@@ -450,7 +456,7 @@ do
                stop_here $this
        fi
 
-       printf 'Applying %s\n' "$FIRSTLINE"
+       printf 'Applying: %s\n' "$FIRSTLINE"
 
        case "$resolved" in
        '')