Merge branch 'jh/object-filtering'
[gitweb.git] / git-stash.sh
index 5a5b6b030cb13c6e784529ac364a14361f7976fb..1114005ce2829011cde2e6de608a2b90df355fc9 100755 (executable)
@@ -278,18 +278,7 @@ push_stash () {
                        ;;
                -*)
                        option="$1"
-                       # TRANSLATORS: $option is an invalid option, like
-                       # `--blah-blah'. The 7 spaces at the beginning of the
-                       # second line correspond to "error: ". So you should line
-                       # up the second line with however many characters the
-                       # 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'"
+                       eval_gettextln "error: unknown option for 'stash push': \$option"
                        usage
                        ;;
                *)
@@ -325,6 +314,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 -- "$@"
@@ -334,11 +329,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