]> git.scripts.mit.edu Git - git.git/blobdiff - git-am.sh
repack: make parsed string options const-correct
[git.git] / git-am.sh
index 1cf3d1dacfb2084e9fcc360a6296900b6f9a7d03..7ea40fe6449b665713a8272f125936edf632189b 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -6,7 +6,7 @@ SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
 OPTIONS_SPEC="\
 git am [options] [(<mbox>|<Maildir>)...]
-git am [options] (--resolved | --skip | --abort)
+git am [options] (--continue | --skip | --abort)
 --
 i,interactive   run interactively
 b,binary*       (historical option -- no-op)
@@ -102,7 +102,7 @@ stop_here_user_resolve () {
            printf '%s\n' "$resolvemsg"
            stop_here $1
     fi
-    eval_gettextln "When you have resolved this problem, run \"\$cmdline --resolved\".
+    eval_gettextln "When you have resolved this problem, run \"\$cmdline --continue\".
 If you prefer to skip this patch, run \"\$cmdline --skip\" instead.
 To restore the original branch and stop patching, run \"\$cmdline --abort\"."
 
@@ -506,7 +506,24 @@ then
        esac
        rm -f "$dotest/dirtyindex"
 else
-       # Make sure we are not given --skip, --resolved, nor --abort
+       # Possible stray $dotest directory in the independent-run
+       # case; in the --rebasing case, it is upto the caller
+       # (git-rebase--am) to take care of stray directories.
+       if test -d "$dotest" && test -z "$rebasing"
+       then
+               case "$skip,$resolved,$abort" in
+               ,,t)
+                       rm -fr "$dotest"
+                       exit 0
+                       ;;
+               *)
+                       die "$(eval_gettext "Stray \$dotest directory found.
+Use \"git am --abort\" to remove it.")"
+                       ;;
+               esac
+       fi
+
+       # Make sure we are not given --skip, --continue, nor --abort
        test "$skip$resolved$abort" = "" ||
                die "$(gettext "Resolve operation not in progress, we are not resuming.")"
 
@@ -653,7 +670,7 @@ do
        #  - patch is the patch body.
        #
        # When we are resuming, these files are either already prepared
-       # by the user, or the user can tell us to do so by --resolved flag.
+       # by the user, or the user can tell us to do so by --continue flag.
        case "$resume" in
        '')
                if test -f "$dotest/rebasing"