aboutsummaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-08-23 14:13:07 -0700
committerJunio C Hamano <gitster@pobox.com>2017-08-23 14:13:07 -0700
commit0ca2f3241aadd99265b3e864fe68dddffdeff84f (patch)
treea7040fc6df6fd725d3454c5b5cb4929f53c44051 /git-stash.sh
parentfa2a4bba2cc60bde49d5a64b4df6ae6d36cfa044 (diff)
parentbbffd87d3223b2f5782918eab2e011931bdffdcc (diff)
downloadgit-0ca2f3241aadd99265b3e864fe68dddffdeff84f.tar.gz
git-0ca2f3241aadd99265b3e864fe68dddffdeff84f.tar.xz
Merge branch 'nm/stash-untracked'
"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
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 9aa09c3a3..d7bc3224b 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -300,6 +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 @@ 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