summaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorBrandon Casey <drafnel@gmail.com>2011-08-27 00:59:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-27 18:12:18 (GMT)
commit7474b8b452f2600bd2a9e03f67b83b489aeadb37 (patch)
treefc97c152850004f775335e3bd4a82f1110fd350f /git-stash.sh
parentc995ef49e2a3076236d8fc710cc2015f5ff201c5 (diff)
downloadgit-7474b8b452f2600bd2a9e03f67b83b489aeadb37.zip
git-7474b8b452f2600bd2a9e03f67b83b489aeadb37.tar.gz
git-7474b8b452f2600bd2a9e03f67b83b489aeadb37.tar.bz2
git-stash: remove untracked/ignored directories when stashed
The two new stash options --include-untracked and --all do not remove the untracked and/or ignored files that are stashed if those files reside in a subdirectory. e.g. the following sequence fails: mkdir untracked && echo hello >untracked/file.txt && git stash --include-untracked && test ! -f untracked/file.txt Within the git-stash script, git-clean is used to remove the untracked/ignored files, but since the -d option was not supplied, it does not remove directories. So, add -d to the git-clean arguments, and update the tests to test this functionality. Reported-by: Hilco Wijbenga <hilco.wijbenga@gmail.com> Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 0d167fc..3157917 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -228,7 +228,7 @@ save_stash () {
test "$untracked" = "all" && CLEAN_X_OPTION=-x || CLEAN_X_OPTION=
if test -n "$untracked"
then
- git clean --force --quiet $CLEAN_X_OPTION
+ git clean --force --quiet -d $CLEAN_X_OPTION
fi
if test "$keep_index" = "t" && test -n $i_tree