summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-08-23 23:13:07 +0200
committerJunio C Hamano <gitster@pobox.com>2017-08-23 23:13:07 +0200
commit0ca2f3241aadd99265b3e864fe68dddffdeff84f (patch)
treea7040fc6df6fd725d3454c5b5cb4929f53c44051 /t
parentMerge branch 'jt/sha1-file-cleanup' (diff)
parentstash: clean untracked files before reset (diff)
downloadgit-0ca2f3241aadd99265b3e864fe68dddffdeff84f.tar.xz
git-0ca2f3241aadd99265b3e864fe68dddffdeff84f.zip
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 't')
-rwxr-xr-xt/t3905-stash-include-untracked.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh
index 193adc7b68..bfde4057ad 100755
--- a/t/t3905-stash-include-untracked.sh
+++ b/t/t3905-stash-include-untracked.sh
@@ -211,4 +211,21 @@ test_expect_success 'stash push with $IFS character' '
test_path_is_file bar
'
+cat > .gitignore <<EOF
+ignored
+ignored.d/*
+EOF
+
+test_expect_success 'stash previously ignored file' '
+ git reset HEAD &&
+ git add .gitignore &&
+ git commit -m "Add .gitignore" &&
+ >ignored.d/foo &&
+ echo "!ignored.d/foo" >> .gitignore &&
+ git stash save --include-untracked &&
+ test_path_is_missing ignored.d/foo &&
+ git stash pop &&
+ test_path_is_file ignored.d/foo
+'
+
test_done