Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
cf286d5e
Commit
cf286d5e
authored
Dec 12, 2019
by
Laurence McGlashan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attr: Update definition of binary macro
parent
6bd37c34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
src/attrcache.c
+1
-1
tests/attr/macro.c
+6
-4
No files found.
src/attrcache.c
View file @
cf286d5e
...
...
@@ -403,7 +403,7 @@ int git_attr_cache__init(git_repository *repo)
git_config_free
(
cfg
);
/* insert default macros */
return
git_attr_add_macro
(
repo
,
"binary"
,
"-diff -
crlf -text
"
);
return
git_attr_add_macro
(
repo
,
"binary"
,
"-diff -
merge -text -crlf
"
);
cancel
:
attr_cache__free
(
cache
);
...
...
tests/attr/macro.c
View file @
cf286d5e
...
...
@@ -20,20 +20,22 @@ void test_attr_macro__cleanup(void)
void
test_attr_macro__macros
(
void
)
{
const
char
*
names
[
5
]
=
{
"rootattr"
,
"binary"
,
"diff"
,
"crlf
"
,
"frotz"
};
const
char
*
names
[
7
]
=
{
"rootattr"
,
"binary"
,
"diff"
,
"crlf"
,
"merge"
,
"text
"
,
"frotz"
};
const
char
*
names2
[
5
]
=
{
"mymacro"
,
"positive"
,
"negative"
,
"rootattr"
,
"another"
};
const
char
*
names3
[
3
]
=
{
"macro2"
,
"multi2"
,
"multi3"
};
const
char
*
values
[
5
];
const
char
*
values
[
7
];
g_repo
=
cl_git_sandbox_init
(
"attr"
);
cl_git_pass
(
git_attr_get_many
(
values
,
g_repo
,
0
,
"binfile"
,
5
,
names
));
cl_git_pass
(
git_attr_get_many
(
values
,
g_repo
,
0
,
"binfile"
,
7
,
names
));
cl_assert
(
GIT_ATTR_IS_TRUE
(
values
[
0
]));
cl_assert
(
GIT_ATTR_IS_TRUE
(
values
[
1
]));
cl_assert
(
GIT_ATTR_IS_FALSE
(
values
[
2
]));
cl_assert
(
GIT_ATTR_IS_FALSE
(
values
[
3
]));
cl_assert
(
GIT_ATTR_IS_UNSPECIFIED
(
values
[
4
]));
cl_assert
(
GIT_ATTR_IS_FALSE
(
values
[
4
]));
cl_assert
(
GIT_ATTR_IS_FALSE
(
values
[
5
]));
cl_assert
(
GIT_ATTR_IS_UNSPECIFIED
(
values
[
6
]));
cl_git_pass
(
git_attr_get_many
(
values
,
g_repo
,
0
,
"macro_test"
,
5
,
names2
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment