File tree Expand file tree Collapse file tree 1 file changed +23
-36
lines changed Expand file tree Collapse file tree 1 file changed +23
-36
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,25 @@ test_expect_success 'setup' '
38
38
) >a/b/.gitattributes &&
39
39
(
40
40
echo "global test=global"
41
- ) >"$HOME"/global-gitattributes
41
+ ) >"$HOME"/global-gitattributes &&
42
+ cat <<EOF >expect-all
43
+ f: test: f
44
+ a/f: test: f
45
+ a/c/f: test: f
46
+ a/g: test: a/g
47
+ a/b/g: test: a/b/g
48
+ b/g: test: unspecified
49
+ a/b/h: test: a/b/h
50
+ a/b/d/g: test: a/b/d/*
51
+ onoff: test: unset
52
+ offon: test: set
53
+ no: notest: set
54
+ no: test: unspecified
55
+ a/b/d/no: notest: set
56
+ a/b/d/no: test: a/b/d/*
57
+ a/b/d/yes: notest: set
58
+ a/b/d/yes: test: unspecified
59
+ EOF
42
60
43
61
'
44
62
@@ -87,47 +105,16 @@ test_expect_success 'core.attributesfile' '
87
105
88
106
test_expect_success ' attribute test: read paths from stdin' '
89
107
90
- cat <<EOF > expect &&
91
- f: test: f
92
- a/f: test: f
93
- a/c/f: test: f
94
- a/g: test: a/g
95
- a/b/g: test: a/b/g
96
- b/g: test: unspecified
97
- a/b/h: test: a/b/h
98
- a/b/d/g: test: a/b/d/*
99
- onoff: test: unset
100
- offon: test: set
101
- no: test: unspecified
102
- a/b/d/no: test: a/b/d/*
103
- a/b/d/yes: test: unspecified
104
- EOF
105
-
108
+ grep -v notest < expect-all > expect &&
106
109
sed -e "s/:.*//" < expect | git check-attr --stdin test > actual &&
107
110
test_cmp expect actual
108
111
'
109
112
110
113
test_expect_success ' attribute test: --all option' '
111
114
112
- cat <<EOF > all &&
113
- f: test: f
114
- a/f: test: f
115
- a/c/f: test: f
116
- a/g: test: a/g
117
- a/b/g: test: a/b/g
118
- b/g: test: unspecified
119
- a/b/h: test: a/b/h
120
- a/b/d/g: test: a/b/d/*
121
- onoff: test: unset
122
- offon: test: set
123
- no: notest: set
124
- a/b/d/no: test: a/b/d/*
125
- a/b/d/no: notest: set
126
- a/b/d/yes: notest: set
127
- EOF
128
-
129
- grep -v unspecified < all | sort > expect &&
130
- sed -e "s/:.*//" < all | uniq | git check-attr --stdin --all | sort > actual &&
115
+ grep -v unspecified < expect-all | sort > expect &&
116
+ sed -e "s/:.*//" < expect-all | uniq |
117
+ git check-attr --stdin --all | sort > actual &&
131
118
test_cmp expect actual
132
119
'
133
120
You can’t perform that action at this time.
0 commit comments