From: Junio C Hamano Date: Sun, 20 Aug 2017 06:07:14 +0000 (-0700) Subject: Merge branch 'nm/stash-untracked' into next X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/70990d7eb3bbaf330b8b40f394bc3f1315d47dea?hp=-c Merge branch 'nm/stash-untracked' into next "git stash -u" used the contents of the committed version of the ".gitignore" file to decide which paths are ignored, even when the file has local changes. The command has been taught to instead use the locally modified contents. * nm/stash-untracked: stash: clean untracked files before reset --- 70990d7eb3bbaf330b8b40f394bc3f1315d47dea diff --combined git-stash.sh index 9aa09c3a33,39083b4d97..d7bc3224bf --- a/git-stash.sh +++ b/git-stash.sh @@@ -300,6 -300,12 +300,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 -- "$@" @@@ -309,11 -315,6 +315,6 @@@ 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 @@@ -573,7 -574,7 +574,7 @@@ apply_stash () if test -n "$u_tree" then - GIT_INDEX_FILE="$TMPindex" git-read-tree "$u_tree" && + GIT_INDEX_FILE="$TMPindex" git read-tree "$u_tree" && GIT_INDEX_FILE="$TMPindex" git checkout-index --all && rm -f "$TMPindex" || die "$(gettext "Could not restore untracked files from stash entry")"