Merge branch 'ds/add-rm-with-sparse-index'

Regression fix.

* ds/add-rm-with-sparse-index:
  dir: fix directory-matching bug
This commit is contained in:
Junio C Hamano
2021-11-03 13:32:28 -07:00
2 changed files with 27 additions and 1 deletions

View File

@ -803,6 +803,32 @@ test_expect_success 'existing directory and file' '
grep top-level-dir actual
'
test_expect_success 'exact prefix matching (with root)' '
test_when_finished rm -r a &&
mkdir -p a/git a/git-foo &&
touch a/git/foo a/git-foo/bar &&
echo /git/ >a/.gitignore &&
git check-ignore a/git a/git/foo a/git-foo a/git-foo/bar >actual &&
cat >expect <<-\EOF &&
a/git
a/git/foo
EOF
test_cmp expect actual
'
test_expect_success 'exact prefix matching (without root)' '
test_when_finished rm -r a &&
mkdir -p a/git a/git-foo &&
touch a/git/foo a/git-foo/bar &&
echo git/ >a/.gitignore &&
git check-ignore a/git a/git/foo a/git-foo a/git-foo/bar >actual &&
cat >expect <<-\EOF &&
a/git
a/git/foo
EOF
test_cmp expect actual
'
############################################################################
#
# test whitespace handling