summaryrefslogtreecommitdiff
path: root/t/t3905-stash-include-untracked.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-03-07 15:29:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-08 01:38:00 (GMT)
commit1366c78c239e7abb24d5b74cedf237f82125492d (patch)
tree695bfe1ee567840c8e422642def689aa5a3b5a88 /t/t3905-stash-include-untracked.sh
parent7b556aa4b80ddfedb3de25e8787acd6c69d8799c (diff)
downloadgit-1366c78c239e7abb24d5b74cedf237f82125492d.zip
git-1366c78c239e7abb24d5b74cedf237f82125492d.tar.gz
git-1366c78c239e7abb24d5b74cedf237f82125492d.tar.bz2
built-in stash: handle :(glob) pathspecs again
When passing a list of pathspecs to, say, `git add`, we need to be careful to use the original form, not the parsed form of the pathspecs. This makes a difference e.g. when calling git stash -- ':(glob)**/*.txt' where the original form includes the `:(glob)` prefix while the parsed form does not. However, in the built-in `git stash`, we passed the parsed (i.e. incorrect) form, and `git add` would fail with the error message: fatal: pathspec '**/*.txt' did not match any files at the stage where `git stash` drops the changes from the worktree, even if `refs/stash` has been actually updated successfully. This fixes https://github.com/git-for-windows/git/issues/2037 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3905-stash-include-untracked.sh')
-rwxr-xr-xt/t3905-stash-include-untracked.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh
index cc1c8a7..29ca76f 100755
--- a/t/t3905-stash-include-untracked.sh
+++ b/t/t3905-stash-include-untracked.sh
@@ -283,4 +283,10 @@ test_expect_success 'stash -u -- <non-existant> shows no changes when there are
test_i18ncmp expect actual
'
+test_expect_success 'stash -u with globs' '
+ >untracked.txt &&
+ git stash -u -- ":(glob)**/*.txt" &&
+ test_path_is_missing untracked.txt
+'
+
test_done