diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2021-11-19 17:13:49 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-11-23 01:53:23 +0300 |
commit | 33c5d6c8456ecb1e89450483586f5f3f115ffa93 (patch) | |
tree | 5706a3cdf0db7b5d86eb158b4b35a60792e306c8 /t/t0008-ignores.sh | |
parent | 5ceb663e926bd22248d1d72d70fa701c558587ea (diff) |
dir: revert "dir: select directories correctly"
This reverts commit f6526728f950cacfd5b5e42bcc65f2c47f3da654.
The change in f652672 (dir: select directories correctly, 2021-09-24)
caused a regression in directory-based matches with non-cone-mode
patterns, especially for .gitignore patterns. A test is included to
prevent this regression in the future.
The commit ed495847 (dir: fix pattern matching on dirs, 2021-09-24) was
reverted in 5ceb663 (dir: fix directory-matching bug, 2021-11-02) for
similar reasons. Neither commit changed tests, and tests added later in
the series continue to pass when these commits are reverted.
Reported-by: Danial Alihosseini <danial.alihosseini@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0008-ignores.sh')
-rwxr-xr-x | t/t0008-ignores.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh index 46a5038fed..fce7c7b408 100755 --- a/t/t0008-ignores.sh +++ b/t/t0008-ignores.sh @@ -828,6 +828,23 @@ test_expect_success 'exact prefix matching (without root)' ' test_cmp expect actual ' +test_expect_success 'directories and ** matches' ' + cat >.gitignore <<-\EOF && + data/** + !data/**/ + !data/**/*.txt + EOF + git check-ignore file \ + data/file data/data1/file1 data/data1/file1.txt \ + data/data2/file2 data/data2/file2.txt >actual && + cat >expect <<-\EOF && + data/file + data/data1/file1 + data/data2/file2 + EOF + test_cmp expect actual +' + ############################################################################ # # test whitespace handling |