libgit2/libgit2 — Issue #533: attribute lookup cannot use multi-level relative paths
Author: peff
Created: 2012-01-12 03:44:43+00:00
State: open

If I have a .gitattributes file in a subdirectory, with upstream git I can reference a file deeper in the path like this:

```
mkdir one
echo two/three test=yes >one/.gitattributes
git check-attr test one/two/three
```

But libgit2 fails to match it. Squashable clay test below.

```
diff --git a/tests-clay/attr/repo.c b/tests-clay/attr/repo.c
index 3e9b9de..e6b8382 100644
--- a/tests-clay/attr/repo.c
+++ b/tests-clay/attr/repo.c
@@ -58,6 +58,7 @@ void test_attr_repo__get_one(void)
{ "subdir/subdir_test2.txt", "negattr", GIT_ATTR_FALSE },
{ "subdir/subdir_test2.txt", "another", "one" },
{ "does-not-exist", "foo", "yes" },
+	{ "subdir/deep/file", "test", GIT_ATTR_TRUE },
{ NULL, NULL, NULL }
}, *scan;

diff --git a/tests/resources/attr/subdir/.gitattributes b/tests/resources/attr/subdir/.gitattributes
index 99eae47..23e3f92 100644
--- a/tests/resources/attr/subdir/.gitattributes
+++ b/tests/resources/attr/subdir/.gitattributes
@@ -3,3 +3,4 @@ subdir/*.txt another=one
ab*	merge=filfre
abc	-foo -bar
*.c	frotz
+deep/file test
```

/cc @arrbee