t: check that a pattern without trailing slash matches a directory
authorJeff King <peff@peff.net>
Thu, 28 Mar 2013 21:50:04 +0000 (17:50 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Mar 2013 04:48:27 +0000 (21:48 -0700)
Prior to v1.8.1.1, with:

git init
echo content >foo &&
mkdir subdir &&
echo content >subdir/bar &&
echo "subdir export-ignore" >.gitattributes
git add . &&
git commit -m one &&
git archive HEAD | tar tf -

the resulting archive would contain only "foo" and ".gitattributes",
not subdir. This was broken with a recent change that intended to
allow "subdir/ export-ignore" to also exclude the directory, but
instead ended up _requiring_ the trailing slash by mistake.

A pattern "subdir" should match any path "subdir", whether it is a
directory or a non-directory. A pattern "subdir/" insists that a
path "subdir" must be a directory for it to match.

This patch adds test not just for this simple case, but also for
deeper cross-directory cases, as well as cases with wildcards.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found