Skip to content

Commit 78cec75

Browse files
committed
t0003: remove extra whitespaces
The test had excess whitespaces everywhere that made it harder to read than necessary. Remove them. Signed-off-by: Junio C Hamano <[email protected]>
1 parent b2b3e9c commit 78cec75

File tree

1 file changed

+22
-46
lines changed

1 file changed

+22
-46
lines changed

t/t0003-attributes.sh

Lines changed: 22 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@ test_description=gitattributes
55
. ./test-lib.sh
66

77
attr_check () {
8-
9-
path="$1"
10-
expect="$2"
8+
path="$1" expect="$2"
119

1210
git check-attr test -- "$path" >actual 2>err &&
1311
echo "$path: test: $2" >expect &&
1412
test_cmp expect actual &&
1513
test_line_count = 0 err
16-
1714
}
1815

1916

2017
test_expect_success 'setup' '
21-
2218
mkdir -p a/b/d a/c b &&
2319
(
2420
echo "[attr]notest !test"
@@ -40,29 +36,27 @@ test_expect_success 'setup' '
4036
(
4137
echo "global test=global"
4238
) >"$HOME"/global-gitattributes &&
43-
cat <<EOF >expect-all
44-
f: test: f
45-
a/f: test: f
46-
a/c/f: test: f
47-
a/g: test: a/g
48-
a/b/g: test: a/b/g
49-
b/g: test: unspecified
50-
a/b/h: test: a/b/h
51-
a/b/d/g: test: a/b/d/*
52-
onoff: test: unset
53-
offon: test: set
54-
no: notest: set
55-
no: test: unspecified
56-
a/b/d/no: notest: set
57-
a/b/d/no: test: a/b/d/*
58-
a/b/d/yes: notest: set
59-
a/b/d/yes: test: unspecified
60-
EOF
61-
39+
cat <<-EOF >expect-all
40+
f: test: f
41+
a/f: test: f
42+
a/c/f: test: f
43+
a/g: test: a/g
44+
a/b/g: test: a/b/g
45+
b/g: test: unspecified
46+
a/b/h: test: a/b/h
47+
a/b/d/g: test: a/b/d/*
48+
onoff: test: unset
49+
offon: test: set
50+
no: notest: set
51+
no: test: unspecified
52+
a/b/d/no: notest: set
53+
a/b/d/no: test: a/b/d/*
54+
a/b/d/yes: notest: set
55+
a/b/d/yes: test: unspecified
56+
EOF
6257
'
6358

6459
test_expect_success 'command line checks' '
65-
6660
test_must_fail git check-attr &&
6761
test_must_fail git check-attr -- &&
6862
test_must_fail git check-attr test &&
@@ -72,11 +66,9 @@ test_expect_success 'command line checks' '
7266
echo "f" | test_must_fail git check-attr --stdin -- f &&
7367
echo "f" | test_must_fail git check-attr --stdin test -- f &&
7468
test_must_fail git check-attr "" -- f
75-
7669
'
7770

7871
test_expect_success 'attribute test' '
79-
8072
attr_check f f &&
8173
attr_check a/f f &&
8274
attr_check a/c/f f &&
@@ -90,20 +82,16 @@ test_expect_success 'attribute test' '
9082
attr_check no unspecified &&
9183
attr_check a/b/d/no "a/b/d/*" &&
9284
attr_check a/b/d/yes unspecified
93-
9485
'
9586

9687
test_expect_success 'unnormalized paths' '
97-
9888
attr_check ./f f &&
9989
attr_check ./a/g a/g &&
10090
attr_check a/./g a/g &&
10191
attr_check a/c/../b/g a/b/g
102-
10392
'
10493

10594
test_expect_success 'relative paths' '
106-
10795
(cd a && attr_check ../f f) &&
10896
(cd a && attr_check f f) &&
10997
(cd a && attr_check i a/i) &&
@@ -112,7 +100,6 @@ test_expect_success 'relative paths' '
112100
(cd b && attr_check ../a/f f) &&
113101
(cd b && attr_check ../a/g a/g) &&
114102
(cd b && attr_check ../a/b/g a/b/g)
115-
116103
'
117104

118105
test_expect_success 'core.attributesfile' '
@@ -121,27 +108,24 @@ test_expect_success 'core.attributesfile' '
121108
attr_check global global &&
122109
git config core.attributesfile "~/global-gitattributes" &&
123110
attr_check global global &&
124-
echo "global test=precedence" >> .gitattributes &&
111+
echo "global test=precedence" >>.gitattributes &&
125112
attr_check global precedence
126113
'
127114

128115
test_expect_success 'attribute test: read paths from stdin' '
129-
130-
grep -v notest < expect-all > expect &&
131-
sed -e "s/:.*//" < expect | git check-attr --stdin test > actual &&
116+
grep -v notest <expect-all >expect &&
117+
sed -e "s/:.*//" <expect | git check-attr --stdin test >actual &&
132118
test_cmp expect actual
133119
'
134120

135121
test_expect_success 'attribute test: --all option' '
136-
137122
grep -v unspecified <expect-all | sort >specified-all &&
138123
sed -e "s/:.*//" <expect-all | uniq >stdin-all &&
139124
git check-attr --stdin --all <stdin-all | sort >actual &&
140125
test_cmp specified-all actual
141126
'
142127

143128
test_expect_success 'attribute test: --cached option' '
144-
145129
: >empty &&
146130
git check-attr --cached --stdin --all <stdin-all | sort >actual &&
147131
test_cmp empty actual &&
@@ -151,21 +135,16 @@ test_expect_success 'attribute test: --cached option' '
151135
'
152136

153137
test_expect_success 'root subdir attribute test' '
154-
155138
attr_check a/i a/i &&
156139
attr_check subdir/a/i unspecified
157-
158140
'
159141

160142
test_expect_success 'setup bare' '
161-
162143
git clone --bare . bare.git &&
163144
cd bare.git
164-
165145
'
166146

167147
test_expect_success 'bare repository: check that .gitattribute is ignored' '
168-
169148
(
170149
echo "f test=f"
171150
echo "a/i test=a/i"
@@ -175,7 +154,6 @@ test_expect_success 'bare repository: check that .gitattribute is ignored' '
175154
attr_check a/c/f unspecified &&
176155
attr_check a/i unspecified &&
177156
attr_check subdir/a/i unspecified
178-
179157
'
180158

181159
test_expect_success 'bare repository: check that --cached honors index' '
@@ -186,7 +164,6 @@ test_expect_success 'bare repository: check that --cached honors index' '
186164
'
187165

188166
test_expect_success 'bare repository: test info/attributes' '
189-
190167
(
191168
echo "f test=f"
192169
echo "a/i test=a/i"
@@ -196,7 +173,6 @@ test_expect_success 'bare repository: test info/attributes' '
196173
attr_check a/c/f f &&
197174
attr_check a/i a/i &&
198175
attr_check subdir/a/i unspecified
199-
200176
'
201177

202178
test_done

0 commit comments

Comments
 (0)