diff options
author | Vicent Martà <vicent@github.com> | 2013-09-17 09:57:55 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-09-17 09:57:55 -0700 |
commit | bb371b62e950e3307d3acf2f772495a60565d266 (patch) | |
tree | b4479ec3ad261bcac13493ee3f5ad45d15dfdda2 /tests-clar/attr/repo.c | |
parent | 4581f9d8ab72e9b97817e1eaa7154bcec1c7f0b1 (diff) | |
parent | f60ed4e6495b8bf68d0604335672e6f300330b3b (diff) | |
download | libgit2-bb371b62e950e3307d3acf2f772495a60565d266.tar.gz |
Merge pull request #1847 from libgit2/filters-alternative
Alternative proposal for filter API
Diffstat (limited to 'tests-clar/attr/repo.c')
-rw-r--r-- | tests-clar/attr/repo.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests-clar/attr/repo.c b/tests-clar/attr/repo.c index ca3e71e7f..ef2ad5ce9 100644 --- a/tests-clar/attr/repo.c +++ b/tests-clar/attr/repo.c @@ -100,6 +100,22 @@ void test_attr_repo__get_many(void) cl_assert_equal_s("yes", values[3]); } +void test_attr_repo__get_many_in_place(void) +{ + const char *vals[4] = { "repoattr", "rootattr", "missingattr", "subattr" }; + + /* it should be legal to look up values into the same array that has + * the attribute names, overwriting each name as the value is found. + */ + + cl_git_pass(git_attr_get_many(vals, g_repo, 0, "sub/subdir_test1", 4, vals)); + + cl_assert(GIT_ATTR_TRUE(vals[0])); + cl_assert(GIT_ATTR_TRUE(vals[1])); + cl_assert(GIT_ATTR_UNSPECIFIED(vals[2])); + cl_assert_equal_s("yes", vals[3]); +} + static int count_attrs( const char *name, const char *value, |