diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:47:08 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:47:08 +0000 |
commit | 29b5ab554790bb57337a3b6ab9dcd963cf69d22e (patch) | |
tree | be1456d2bc6c1fb078695fad7bc8f6b212062d3c /tests/resources/attr/sub/abc | |
parent | Initial commit. (diff) | |
download | libgit2-29b5ab554790bb57337a3b6ab9dcd963cf69d22e.tar.xz libgit2-29b5ab554790bb57337a3b6ab9dcd963cf69d22e.zip |
Adding upstream version 1.7.2+ds.upstream/1.7.2+ds
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/resources/attr/sub/abc')
-rw-r--r-- | tests/resources/attr/sub/abc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/resources/attr/sub/abc b/tests/resources/attr/sub/abc new file mode 100644 index 0000000..3e42ffc --- /dev/null +++ b/tests/resources/attr/sub/abc @@ -0,0 +1,37 @@ +# Test file from gitattributes(5) example: + +If you have these three gitattributes file: + + (in $GIT_DIR/info/attributes) + + a* foo !bar -baz + + (in .gitattributes) + abc foo bar baz + + (in t/.gitattributes) + ab* merge=filfre + abc -foo -bar + *.c frotz + +the attributes given to path t/abc are computed as follows: + +1. By examining t/.gitattributes (which is in the same directory as the path + in question), git finds that the first line matches. merge attribute is + set. It also finds that the second line matches, and attributes foo and + bar are unset. +2. Then it examines .gitattributes (which is in the parent directory), and + finds that the first line matches, but t/.gitattributes file already + decided how merge, foo and bar attributes should be given to this path, + so it leaves foo and bar unset. Attribute baz is set. +3. Finally it examines $GIT_DIR/info/attributes. This file is used to + override the in-tree settings. The first line is a match, and foo is set, + bar is reverted to unspecified state, and baz is unset. + +As the result, the attributes assignment to t/abc becomes: + + foo set to true + bar unspecified + baz set to false + merge set to string value "filfre" + frotz unspecified |