diff options
Diffstat (limited to 'tests-clar/resources/attr/sub')
| -rw-r--r-- | tests-clar/resources/attr/sub/.gitattributes | 7 | ||||
| -rw-r--r-- | tests-clar/resources/attr/sub/abc | 37 | ||||
| -rw-r--r-- | tests-clar/resources/attr/sub/dir/file | 0 | ||||
| -rw-r--r-- | tests-clar/resources/attr/sub/file | 1 | ||||
| -rw-r--r-- | tests-clar/resources/attr/sub/ign | 1 | ||||
| -rw-r--r-- | tests-clar/resources/attr/sub/sub/.gitattributes | 3 | ||||
| -rw-r--r-- | tests-clar/resources/attr/sub/sub/dir | 0 | ||||
| -rw-r--r-- | tests-clar/resources/attr/sub/sub/file | 1 | ||||
| -rw-r--r-- | tests-clar/resources/attr/sub/sub/subsub.txt | 1 | ||||
| -rw-r--r-- | tests-clar/resources/attr/sub/subdir_test1 | 2 | ||||
| -rw-r--r-- | tests-clar/resources/attr/sub/subdir_test2.txt | 1 |
11 files changed, 54 insertions, 0 deletions
diff --git a/tests-clar/resources/attr/sub/.gitattributes b/tests-clar/resources/attr/sub/.gitattributes new file mode 100644 index 00000000..329c1c5b --- /dev/null +++ b/tests-clar/resources/attr/sub/.gitattributes @@ -0,0 +1,7 @@ +* subattr=yes -negattr +*.txt another=zero +sub/*.txt another=one +ab* merge=filfre +abc -foo -bar +*.c frotz +deep/file deepdeep diff --git a/tests-clar/resources/attr/sub/abc b/tests-clar/resources/attr/sub/abc new file mode 100644 index 00000000..3e42ffc5 --- /dev/null +++ b/tests-clar/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 diff --git a/tests-clar/resources/attr/sub/dir/file b/tests-clar/resources/attr/sub/dir/file new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests-clar/resources/attr/sub/dir/file diff --git a/tests-clar/resources/attr/sub/file b/tests-clar/resources/attr/sub/file new file mode 100644 index 00000000..45b983be --- /dev/null +++ b/tests-clar/resources/attr/sub/file @@ -0,0 +1 @@ +hi diff --git a/tests-clar/resources/attr/sub/ign b/tests-clar/resources/attr/sub/ign new file mode 100644 index 00000000..592fd259 --- /dev/null +++ b/tests-clar/resources/attr/sub/ign @@ -0,0 +1 @@ +ignore me diff --git a/tests-clar/resources/attr/sub/sub/.gitattributes b/tests-clar/resources/attr/sub/sub/.gitattributes new file mode 100644 index 00000000..55225e4d --- /dev/null +++ b/tests-clar/resources/attr/sub/sub/.gitattributes @@ -0,0 +1,3 @@ +d/* test=a/b/d/* +d/yes notest + diff --git a/tests-clar/resources/attr/sub/sub/dir b/tests-clar/resources/attr/sub/sub/dir new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests-clar/resources/attr/sub/sub/dir diff --git a/tests-clar/resources/attr/sub/sub/file b/tests-clar/resources/attr/sub/sub/file new file mode 100644 index 00000000..45b983be --- /dev/null +++ b/tests-clar/resources/attr/sub/sub/file @@ -0,0 +1 @@ +hi diff --git a/tests-clar/resources/attr/sub/sub/subsub.txt b/tests-clar/resources/attr/sub/sub/subsub.txt new file mode 100644 index 00000000..9e5bdc47 --- /dev/null +++ b/tests-clar/resources/attr/sub/sub/subsub.txt @@ -0,0 +1 @@ +subsub diff --git a/tests-clar/resources/attr/sub/subdir_test1 b/tests-clar/resources/attr/sub/subdir_test1 new file mode 100644 index 00000000..e563cf47 --- /dev/null +++ b/tests-clar/resources/attr/sub/subdir_test1 @@ -0,0 +1,2 @@ +Hello from the subdir + diff --git a/tests-clar/resources/attr/sub/subdir_test2.txt b/tests-clar/resources/attr/sub/subdir_test2.txt new file mode 100644 index 00000000..fb5067b1 --- /dev/null +++ b/tests-clar/resources/attr/sub/subdir_test2.txt @@ -0,0 +1 @@ +Hello again |
