@@ -38,19 +38,19 @@ script='s/^\$Id: \([0-9a-f]*\) \$/\1/p'
38
38
39
39
test_expect_success check '
40
40
41
- cmp test.o test &&
42
- cmp test.o test.t &&
41
+ test_cmp test.o test &&
42
+ test_cmp test.o test.t &&
43
43
44
44
# ident should be stripped in the repository
45
45
git diff --raw --exit-code :test :test.i &&
46
46
id=$(git rev-parse --verify :test) &&
47
47
embedded=$(sed -ne "$script" test.i) &&
48
48
test "z$id" = "z$embedded" &&
49
49
50
- git cat-file blob :test.t > test.r &&
50
+ git cat-file blob :test.t >test.r &&
51
51
52
- ./rot13.sh < test.o > test.t &&
53
- cmp test.r test.t
52
+ ./rot13.sh <test.o >test.t &&
53
+ test_cmp test.r test.t
54
54
'
55
55
56
56
# If an expanded ident ever gets into the repository, we want to make sure that
@@ -130,7 +130,7 @@ test_expect_success 'filter shell-escaped filenames' '
130
130
131
131
# delete the files and check them out again, using a smudge filter
132
132
# that will count the args and echo the command-line back to us
133
- git config filter.argc.smudge "sh ./argc.sh %f" &&
133
+ test_config filter.argc.smudge "sh ./argc.sh %f" &&
134
134
rm "$normal" "$special" &&
135
135
git checkout -- "$normal" "$special" &&
136
136
@@ -141,7 +141,7 @@ test_expect_success 'filter shell-escaped filenames' '
141
141
test_cmp expect "$special" &&
142
142
143
143
# do the same thing, but with more args in the filter expression
144
- git config filter.argc.smudge "sh ./argc.sh %f --my-extra-arg" &&
144
+ test_config filter.argc.smudge "sh ./argc.sh %f --my-extra-arg" &&
145
145
rm "$normal" "$special" &&
146
146
git checkout -- "$normal" "$special" &&
147
147
@@ -154,9 +154,9 @@ test_expect_success 'filter shell-escaped filenames' '
154
154
'
155
155
156
156
test_expect_success ' required filter should filter data' '
157
- git config filter.required.smudge ./rot13.sh &&
158
- git config filter.required.clean ./rot13.sh &&
159
- git config filter.required.required true &&
157
+ test_config filter.required.smudge ./rot13.sh &&
158
+ test_config filter.required.clean ./rot13.sh &&
159
+ test_config filter.required.required true &&
160
160
161
161
echo "*.r filter=required" >.gitattributes &&
162
162
@@ -165,17 +165,17 @@ test_expect_success 'required filter should filter data' '
165
165
166
166
rm -f test.r &&
167
167
git checkout -- test.r &&
168
- cmp test.o test.r &&
168
+ test_cmp test.o test.r &&
169
169
170
170
./rot13.sh <test.o >expected &&
171
171
git cat-file blob :test.r >actual &&
172
- cmp expected actual
172
+ test_cmp expected actual
173
173
'
174
174
175
175
test_expect_success ' required filter smudge failure' '
176
- git config filter.failsmudge.smudge false &&
177
- git config filter.failsmudge.clean cat &&
178
- git config filter.failsmudge.required true &&
176
+ test_config filter.failsmudge.smudge false &&
177
+ test_config filter.failsmudge.clean cat &&
178
+ test_config filter.failsmudge.required true &&
179
179
180
180
echo "*.fs filter=failsmudge" >.gitattributes &&
181
181
@@ -186,9 +186,9 @@ test_expect_success 'required filter smudge failure' '
186
186
'
187
187
188
188
test_expect_success ' required filter clean failure' '
189
- git config filter.failclean.smudge cat &&
190
- git config filter.failclean.clean false &&
191
- git config filter.failclean.required true &&
189
+ test_config filter.failclean.smudge cat &&
190
+ test_config filter.failclean.clean false &&
191
+ test_config filter.failclean.required true &&
192
192
193
193
echo "*.fc filter=failclean" >.gitattributes &&
194
194
@@ -197,8 +197,8 @@ test_expect_success 'required filter clean failure' '
197
197
'
198
198
199
199
test_expect_success ' filtering large input to small output should use little memory' '
200
- git config filter.devnull.clean "cat >/dev/null" &&
201
- git config filter.devnull.required true &&
200
+ test_config filter.devnull.clean "cat >/dev/null" &&
201
+ test_config filter.devnull.required true &&
202
202
for i in $(test_seq 1 30); do printf "%1048576d" 1; done >30MB &&
203
203
echo "30MB filter=devnull" >.gitattributes &&
204
204
GIT_MMAP_LIMIT=1m GIT_ALLOC_LIMIT=1m git add 30MB
@@ -207,28 +207,28 @@ test_expect_success 'filtering large input to small output should use little mem
207
207
test_expect_success ' filter that does not read is fine' '
208
208
test-genrandom foo $((128 * 1024 + 1)) >big &&
209
209
echo "big filter=epipe" >.gitattributes &&
210
- git config filter.epipe.clean "echo xyzzy" &&
210
+ test_config filter.epipe.clean "echo xyzzy" &&
211
211
git add big &&
212
212
git cat-file blob :big >actual &&
213
213
echo xyzzy >expect &&
214
214
test_cmp expect actual
215
215
'
216
216
217
217
test_expect_success EXPENSIVE ' filter large file' '
218
- git config filter.largefile.smudge cat &&
219
- git config filter.largefile.clean cat &&
218
+ test_config filter.largefile.smudge cat &&
219
+ test_config filter.largefile.clean cat &&
220
220
for i in $(test_seq 1 2048); do printf "%1048576d" 1; done >2GB &&
221
221
echo "2GB filter=largefile" >.gitattributes &&
222
222
git add 2GB 2>err &&
223
- ! test -s err &&
223
+ test_must_be_empty err &&
224
224
rm -f 2GB &&
225
225
git checkout -- 2GB 2>err &&
226
- ! test -s err
226
+ test_must_be_empty err
227
227
'
228
228
229
229
test_expect_success " filter: clean empty file" '
230
- git config filter.in-repo-header.clean "echo cleaned && cat" &&
231
- git config filter.in-repo-header.smudge "sed 1d" &&
230
+ test_config filter.in-repo-header.clean "echo cleaned && cat" &&
231
+ test_config filter.in-repo-header.smudge "sed 1d" &&
232
232
233
233
echo "empty-in-worktree filter=in-repo-header" >>.gitattributes &&
234
234
>empty-in-worktree &&
@@ -240,8 +240,8 @@ test_expect_success "filter: clean empty file" '
240
240
'
241
241
242
242
test_expect_success " filter: smudge empty file" '
243
- git config filter.empty-in-repo.clean "cat >/dev/null" &&
244
- git config filter.empty-in-repo.smudge "echo smudged && cat" &&
243
+ test_config filter.empty-in-repo.clean "cat >/dev/null" &&
244
+ test_config filter.empty-in-repo.smudge "echo smudged && cat" &&
245
245
246
246
echo "empty-in-repo filter=empty-in-repo" >>.gitattributes &&
247
247
echo dead data walking >empty-in-repo &&
0 commit comments