stash: mark "git stash save" deprecated in the man page
[gitweb.git] / git-stash.sh
index 328cd80d83a03a674e0541bddb6bce0532c682b7..3a4e5d157c4376fc1253377f1d1b5b73bd929e02 100755 (executable)
@@ -267,11 +267,11 @@ push_stash () {
                        # translation of "error: " takes in your language. E.g. in
                        # English this is:
                        #
-                       #    $ git stash save --blah-blah 2>&1 | head -n 2
-                       #    error: unknown option for 'stash save': --blah-blah
-                       #           To provide a message, use git stash save -- '--blah-blah'
-                       eval_gettextln "error: unknown option for 'stash save': \$option
-       To provide a message, use git stash save -- '\$option'"
+                       #    $ git stash push --blah-blah 2>&1 | head -n 2
+                       #    error: unknown option for 'stash push': --blah-blah
+                       #           To provide a message, use git stash push -m '--blah-blah'
+                       eval_gettextln "error: unknown option for 'stash push': \$option
+       To provide a message, use git stash push -m '\$option'"
                        usage
                        ;;
                *)
@@ -307,6 +307,12 @@ push_stash () {
 
        if test -z "$patch_mode"
        then
+               test "$untracked" = "all" && CLEAN_X_OPTION=-x || CLEAN_X_OPTION=
+               if test -n "$untracked"
+               then
+                       git clean --force --quiet -d $CLEAN_X_OPTION -- "$@"
+               fi
+
                if test $# != 0
                then
                        git reset -q -- "$@"
@@ -316,11 +322,6 @@ push_stash () {
                else
                        git reset --hard -q
                fi
-               test "$untracked" = "all" && CLEAN_X_OPTION=-x || CLEAN_X_OPTION=
-               if test -n "$untracked"
-               then
-                       git clean --force --quiet -d $CLEAN_X_OPTION -- "$@"
-               fi
 
                if test "$keep_index" = "t" && test -n "$i_tree"
                then