Skip to content

Commit b317858

Browse files
authored
Merge pull request libgit2#5333 from lrm29/attr_binary_macro
attr: Update definition of binary macro
2 parents 6777db8 + cf286d5 commit b317858

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/attrcache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ int git_attr_cache__init(git_repository *repo)
403403
git_config_free(cfg);
404404

405405
/* insert default macros */
406-
return git_attr_add_macro(repo, "binary", "-diff -crlf -text");
406+
return git_attr_add_macro(repo, "binary", "-diff -merge -text -crlf");
407407

408408
cancel:
409409
attr_cache__free(cache);

tests/attr/macro.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,22 @@ void test_attr_macro__cleanup(void)
2020

2121
void test_attr_macro__macros(void)
2222
{
23-
const char *names[5] = { "rootattr", "binary", "diff", "crlf", "frotz" };
23+
const char *names[7] = { "rootattr", "binary", "diff", "crlf", "merge", "text", "frotz" };
2424
const char *names2[5] = { "mymacro", "positive", "negative", "rootattr", "another" };
2525
const char *names3[3] = { "macro2", "multi2", "multi3" };
26-
const char *values[5];
26+
const char *values[7];
2727

2828
g_repo = cl_git_sandbox_init("attr");
2929

30-
cl_git_pass(git_attr_get_many(values, g_repo, 0, "binfile", 5, names));
30+
cl_git_pass(git_attr_get_many(values, g_repo, 0, "binfile", 7, names));
3131

3232
cl_assert(GIT_ATTR_IS_TRUE(values[0]));
3333
cl_assert(GIT_ATTR_IS_TRUE(values[1]));
3434
cl_assert(GIT_ATTR_IS_FALSE(values[2]));
3535
cl_assert(GIT_ATTR_IS_FALSE(values[3]));
36-
cl_assert(GIT_ATTR_IS_UNSPECIFIED(values[4]));
36+
cl_assert(GIT_ATTR_IS_FALSE(values[4]));
37+
cl_assert(GIT_ATTR_IS_FALSE(values[5]));
38+
cl_assert(GIT_ATTR_IS_UNSPECIFIED(values[6]));
3739

3840
cl_git_pass(git_attr_get_many(values, g_repo, 0, "macro_test", 5, names2));
3941

0 commit comments

Comments
 (0)