]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-stash.sh
Merge branch 'hn/submodule-comment'
[thirdparty/git.git] / git-stash.sh
index 328cd80d83a03a674e0541bddb6bce0532c682b7..8b2ce9afdab6d67e8b9af5fc97a30dc6941323f2 100755 (executable)
@@ -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