diff options
Diffstat (limited to 'tests/resources/attr/sub')
-rw-r--r-- | tests/resources/attr/sub/.gitattributes | 7 | ||||
-rw-r--r-- | tests/resources/attr/sub/abc | 37 | ||||
-rw-r--r-- | tests/resources/attr/sub/dir/file | 0 | ||||
-rw-r--r-- | tests/resources/attr/sub/file | 1 | ||||
-rw-r--r-- | tests/resources/attr/sub/ign/file | 1 | ||||
-rw-r--r-- | tests/resources/attr/sub/ign/sub/file | 1 | ||||
-rw-r--r-- | tests/resources/attr/sub/sub/.gitattributes | 3 | ||||
-rw-r--r-- | tests/resources/attr/sub/sub/dir | 0 | ||||
-rw-r--r-- | tests/resources/attr/sub/sub/file | 1 | ||||
-rw-r--r-- | tests/resources/attr/sub/sub/subsub.txt | 1 | ||||
-rw-r--r-- | tests/resources/attr/sub/subdir_test1 | 2 | ||||
-rw-r--r-- | tests/resources/attr/sub/subdir_test2.txt | 1 |
12 files changed, 55 insertions, 0 deletions
diff --git a/tests/resources/attr/sub/.gitattributes b/tests/resources/attr/sub/.gitattributes new file mode 100644 index 0000000..329c1c5 --- /dev/null +++ b/tests/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/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 diff --git a/tests/resources/attr/sub/dir/file b/tests/resources/attr/sub/dir/file new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/resources/attr/sub/dir/file diff --git a/tests/resources/attr/sub/file b/tests/resources/attr/sub/file new file mode 100644 index 0000000..45b983b --- /dev/null +++ b/tests/resources/attr/sub/file @@ -0,0 +1 @@ +hi diff --git a/tests/resources/attr/sub/ign/file b/tests/resources/attr/sub/ign/file new file mode 100644 index 0000000..4dcd992 --- /dev/null +++ b/tests/resources/attr/sub/ign/file @@ -0,0 +1 @@ +in ignored dir diff --git a/tests/resources/attr/sub/ign/sub/file b/tests/resources/attr/sub/ign/sub/file new file mode 100644 index 0000000..88aca01 --- /dev/null +++ b/tests/resources/attr/sub/ign/sub/file @@ -0,0 +1 @@ +below ignored dir diff --git a/tests/resources/attr/sub/sub/.gitattributes b/tests/resources/attr/sub/sub/.gitattributes new file mode 100644 index 0000000..55225e4 --- /dev/null +++ b/tests/resources/attr/sub/sub/.gitattributes @@ -0,0 +1,3 @@ +d/* test=a/b/d/* +d/yes notest + diff --git a/tests/resources/attr/sub/sub/dir b/tests/resources/attr/sub/sub/dir new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/resources/attr/sub/sub/dir diff --git a/tests/resources/attr/sub/sub/file b/tests/resources/attr/sub/sub/file new file mode 100644 index 0000000..45b983b --- /dev/null +++ b/tests/resources/attr/sub/sub/file @@ -0,0 +1 @@ +hi diff --git a/tests/resources/attr/sub/sub/subsub.txt b/tests/resources/attr/sub/sub/subsub.txt new file mode 100644 index 0000000..9e5bdc4 --- /dev/null +++ b/tests/resources/attr/sub/sub/subsub.txt @@ -0,0 +1 @@ +subsub diff --git a/tests/resources/attr/sub/subdir_test1 b/tests/resources/attr/sub/subdir_test1 new file mode 100644 index 0000000..e563cf4 --- /dev/null +++ b/tests/resources/attr/sub/subdir_test1 @@ -0,0 +1,2 @@ +Hello from the subdir + diff --git a/tests/resources/attr/sub/subdir_test2.txt b/tests/resources/attr/sub/subdir_test2.txt new file mode 100644 index 0000000..fb5067b --- /dev/null +++ b/tests/resources/attr/sub/subdir_test2.txt @@ -0,0 +1 @@ +Hello again |