Blame tests/resources/attr/sub/abc
|
Packit Service |
20376f |
# Test file from gitattributes(5) example:
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
If you have these three gitattributes file:
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
(in $GIT_DIR/info/attributes)
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
a* foo !bar -baz
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
(in .gitattributes)
|
|
Packit Service |
20376f |
abc foo bar baz
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
(in t/.gitattributes)
|
|
Packit Service |
20376f |
ab* merge=filfre
|
|
Packit Service |
20376f |
abc -foo -bar
|
|
Packit Service |
20376f |
*.c frotz
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
the attributes given to path t/abc are computed as follows:
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
1. By examining t/.gitattributes (which is in the same directory as the path
|
|
Packit Service |
20376f |
in question), git finds that the first line matches. merge attribute is
|
|
Packit Service |
20376f |
set. It also finds that the second line matches, and attributes foo and
|
|
Packit Service |
20376f |
bar are unset.
|
|
Packit Service |
20376f |
2. Then it examines .gitattributes (which is in the parent directory), and
|
|
Packit Service |
20376f |
finds that the first line matches, but t/.gitattributes file already
|
|
Packit Service |
20376f |
decided how merge, foo and bar attributes should be given to this path,
|
|
Packit Service |
20376f |
so it leaves foo and bar unset. Attribute baz is set.
|
|
Packit Service |
20376f |
3. Finally it examines $GIT_DIR/info/attributes. This file is used to
|
|
Packit Service |
20376f |
override the in-tree settings. The first line is a match, and foo is set,
|
|
Packit Service |
20376f |
bar is reverted to unspecified state, and baz is unset.
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
As the result, the attributes assignment to t/abc becomes:
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
foo set to true
|
|
Packit Service |
20376f |
bar unspecified
|
|
Packit Service |
20376f |
baz set to false
|
|
Packit Service |
20376f |
merge set to string value "filfre"
|
|
Packit Service |
20376f |
frotz unspecified
|