Skip to content

Commit 0a41a89

Browse files
committed
Merge branch 'ma/test-quote-cleanup'
Test cleanup. * ma/test-quote-cleanup: t4104: modernize and simplify quoting t: don't spuriously close and reopen quotes
2 parents d1a8a89 + 289218d commit 0a41a89

18 files changed

+53
-80
lines changed

t/t1400-update-ref.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ test_expect_success "create $m (logged by config)" '
324324
test_expect_success "update $m (logged by config)" '
325325
test_config core.logAllRefUpdates true &&
326326
GIT_COMMITTER_DATE="2005-05-26 23:33" \
327-
git update-ref HEAD'" $B $A "'-m "Switch" &&
327+
git update-ref HEAD $B $A -m "Switch" &&
328328
test $B = $(git show-ref -s --verify $m)
329329
'
330330
test_expect_success "set $m (logged by config)" '

t/t3501-revert-cherry-pick.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test_expect_success 'cherry-pick --nonsense' '
4747
git diff --exit-code HEAD &&
4848
test_must_fail git cherry-pick --nonsense 2>msg &&
4949
git diff --exit-code HEAD "$pos" &&
50-
test_i18ngrep '[Uu]sage:' msg
50+
test_i18ngrep "[Uu]sage:" msg
5151
'
5252

5353
test_expect_success 'revert --nonsense' '
@@ -56,7 +56,7 @@ test_expect_success 'revert --nonsense' '
5656
git diff --exit-code HEAD &&
5757
test_must_fail git revert --nonsense 2>msg &&
5858
git diff --exit-code HEAD "$pos" &&
59-
test_i18ngrep '[Uu]sage:' msg
59+
test_i18ngrep "[Uu]sage:" msg
6060
'
6161

6262
test_expect_success 'cherry-pick after renaming branch' '

t/t3507-cherry-pick-conflict.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ test_expect_success 'commit after failed cherry-pick adds -s at the right place'
512512
Signed-off-by: C O Mitter <[email protected]>
513513
# Conflicts:
514514
EOF
515-
grep -e "^# Conflicts:" -e '^Signed-off-by' .git/COMMIT_EDITMSG >actual &&
515+
grep -e "^# Conflicts:" -e "^Signed-off-by" .git/COMMIT_EDITMSG >actual &&
516516
test_cmp expect actual &&
517517
518518
cat <<-\EOF >expected &&
@@ -541,7 +541,7 @@ test_expect_success 'commit --amend -s places the sign-off at the right place' '
541541
Signed-off-by: C O Mitter <[email protected]>
542542
Conflicts:
543543
EOF
544-
grep -e "^Conflicts:" -e '^Signed-off-by' .git/COMMIT_EDITMSG >actual &&
544+
grep -e "^Conflicts:" -e "^Signed-off-by" .git/COMMIT_EDITMSG >actual &&
545545
test_cmp expect actual
546546
'
547547

t/t4005-diff-rename-2.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ test_expect_success 'setup reference tree' '
1414
git update-index --add COPYING rezrov &&
1515
tree=$(git write-tree) &&
1616
echo $tree &&
17-
sed -e 's/HOWEVER/However/' <COPYING >COPYING.1 &&
18-
sed -e 's/GPL/G.P.L/g' <COPYING >COPYING.2 &&
17+
sed -e "s/HOWEVER/However/" <COPYING >COPYING.1 &&
18+
sed -e "s/GPL/G.P.L/g" <COPYING >COPYING.2 &&
1919
origoid=$(git hash-object COPYING) &&
2020
oid1=$(git hash-object COPYING.1) &&
2121
oid2=$(git hash-object COPYING.2)

t/t4034-diff-words.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ test_expect_success 'word diff with runs of whitespace' '
102102
'
103103

104104
test_expect_success '--word-diff=porcelain' '
105-
sed 's/#.*$//' >expect <<-EOF &&
105+
sed "s/#.*$//" >expect <<-EOF &&
106106
diff --git a/pre b/post
107107
index $pre..$post 100644
108108
--- a/pre

t/t4104-apply-boundary.sh

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,80 +3,55 @@
33
# Copyright (c) 2005 Junio C Hamano
44
#
55

6-
test_description='git apply boundary tests
6+
test_description='git apply boundary tests'
77

8-
'
98
. ./test-lib.sh
109

1110
L="c d e f g h i j k l m n o p q r s t u v w x"
1211

1312
test_expect_success setup '
14-
for i in b '"$L"' y
15-
do
16-
echo $i
17-
done >victim &&
13+
test_write_lines b $L y >victim &&
1814
cat victim >original &&
1915
git update-index --add victim &&
2016
2117
# add to the head
22-
for i in a b '"$L"' y
23-
do
24-
echo $i
25-
done >victim &&
18+
test_write_lines a b $L y >victim &&
2619
cat victim >add-a-expect &&
2720
git diff victim >add-a-patch.with &&
2821
git diff --unified=0 >add-a-patch.without &&
2922
3023
# insert at line two
31-
for i in b a '"$L"' y
32-
do
33-
echo $i
34-
done >victim &&
24+
test_write_lines b a $L y >victim &&
3525
cat victim >insert-a-expect &&
3626
git diff victim >insert-a-patch.with &&
3727
git diff --unified=0 >insert-a-patch.without &&
3828
3929
# modify at the head
40-
for i in a '"$L"' y
41-
do
42-
echo $i
43-
done >victim &&
30+
test_write_lines a $L y >victim &&
4431
cat victim >mod-a-expect &&
4532
git diff victim >mod-a-patch.with &&
4633
git diff --unified=0 >mod-a-patch.without &&
4734
4835
# remove from the head
49-
for i in '"$L"' y
50-
do
51-
echo $i
52-
done >victim &&
36+
test_write_lines $L y >victim &&
5337
cat victim >del-a-expect &&
5438
git diff victim >del-a-patch.with &&
5539
git diff --unified=0 >del-a-patch.without &&
5640
5741
# add to the tail
58-
for i in b '"$L"' y z
59-
do
60-
echo $i
61-
done >victim &&
42+
test_write_lines b $L y z >victim &&
6243
cat victim >add-z-expect &&
6344
git diff victim >add-z-patch.with &&
6445
git diff --unified=0 >add-z-patch.without &&
6546
6647
# modify at the tail
67-
for i in b '"$L"' z
68-
do
69-
echo $i
70-
done >victim &&
48+
test_write_lines b $L z >victim &&
7149
cat victim >mod-z-expect &&
7250
git diff victim >mod-z-patch.with &&
7351
git diff --unified=0 >mod-z-patch.without &&
7452
7553
# remove from the tail
76-
for i in b '"$L"'
77-
do
78-
echo $i
79-
done >victim &&
54+
test_write_lines b $L >victim &&
8055
cat victim >del-z-expect &&
8156
git diff victim >del-z-patch.with &&
8257
git diff --unified=0 >del-z-patch.without
@@ -88,15 +63,15 @@ for with in with without
8863
do
8964
case "$with" in
9065
with) u= ;;
91-
without) u='--unidiff-zero ' ;;
66+
without) u=--unidiff-zero ;;
9267
esac
9368
for kind in add-a add-z insert-a mod-a mod-z del-a del-z
9469
do
9570
test_expect_success "apply $kind-patch $with context" '
9671
cat original >victim &&
9772
git update-index victim &&
98-
git apply --index '"$u$kind-patch.$with"' &&
99-
test_cmp '"$kind"'-expect victim
73+
git apply --index $u "$kind-patch.$with" &&
74+
test_cmp "$kind-expect" victim
10075
'
10176
done
10277
done
@@ -110,13 +85,12 @@ do
11085
test_expect_success "apply non-git $kind-patch without context" '
11186
cat original >victim &&
11287
git update-index victim &&
113-
git apply --unidiff-zero --index '"$kind-ng.without"' &&
114-
test_cmp '"$kind"'-expect victim
88+
git apply --unidiff-zero --index "$kind-ng.without" &&
89+
test_cmp "$kind-expect" victim
11590
'
11691
done
11792

11893
test_expect_success 'two lines' '
119-
12094
>file &&
12195
git add file &&
12296
echo aaa >file &&
@@ -125,11 +99,10 @@ test_expect_success 'two lines' '
12599
echo bbb >file &&
126100
git add file &&
127101
test_must_fail git apply --check patch
128-
129102
'
130103

131104
test_expect_success 'apply patch with 3 context lines matching at end' '
132-
{ echo a; echo b; echo c; echo d; } >file &&
105+
test_write_lines a b c d >file &&
133106
git add file &&
134107
echo e >>file &&
135108
git diff >patch &&

t/t4150-am.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ test_expect_success 'am -s unexpected trailer block' '
989989
Signed-off-by: J C H <[email protected]>
990990
EOF
991991
git commit -F msg &&
992-
git cat-file commit HEAD | sed -e '1,/^$/d' >original &&
992+
git cat-file commit HEAD | sed -e "1,/^$/d" >original &&
993993
git format-patch --stdout -1 >patch &&
994994
995995
git reset --hard HEAD^ &&
@@ -998,7 +998,7 @@ test_expect_success 'am -s unexpected trailer block' '
998998
cat original &&
999999
echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
10001000
) >expect &&
1001-
git cat-file commit HEAD | sed -e '1,/^$/d' >actual &&
1001+
git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
10021002
test_cmp expect actual &&
10031003
10041004
cat >msg <<-\EOF &&
@@ -1009,7 +1009,7 @@ test_expect_success 'am -s unexpected trailer block' '
10091009
EOF
10101010
git reset HEAD^ &&
10111011
git commit -F msg file &&
1012-
git cat-file commit HEAD | sed -e '1,/^$/d' >original &&
1012+
git cat-file commit HEAD | sed -e "1,/^$/d" >original &&
10131013
git format-patch --stdout -1 >patch &&
10141014
10151015
git reset --hard HEAD^ &&
@@ -1020,7 +1020,7 @@ test_expect_success 'am -s unexpected trailer block' '
10201020
echo &&
10211021
echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
10221022
) >expect &&
1023-
git cat-file commit HEAD | sed -e '1,/^$/d' >actual &&
1023+
git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
10241024
test_cmp expect actual
10251025
'
10261026

t/t4200-rerere.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ test_expect_success 'set up an unresolved merge' '
363363
git reset --hard &&
364364
git checkout version2 &&
365365
fifth=$(git rev-parse fifth) &&
366-
echo "$fifth branch 'fifth' of ." |
366+
echo "$fifth branch fifth of ." |
367367
git fmt-merge-msg >msg &&
368368
ancestor=$(git merge-base version2 fifth) &&
369369
test_must_fail git merge-recursive "$ancestor" -- HEAD fifth &&

t/t5302-pack-index.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test_expect_success 'setup' '
1414
i=1 &&
1515
while test $i -le 100
1616
do
17-
iii=$(printf '%03i' $i)
17+
iii=$(printf "%03i" $i)
1818
test-tool genrandom "bar" 200 > wide_delta_$iii &&
1919
test-tool genrandom "baz $iii" 50 >> wide_delta_$iii &&
2020
test-tool genrandom "foo"$i 100 > deep_delta_$iii &&

t/t5510-fetch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ test_expect_success 'fetch tags when there is no tags' '
213213
test_expect_success 'fetch following tags' '
214214
215215
cd "$D" &&
216-
git tag -a -m 'annotated' anno HEAD &&
216+
git tag -a -m "annotated" anno HEAD &&
217217
git tag light HEAD &&
218218
219219
mkdir four &&
@@ -335,7 +335,7 @@ test_expect_success 'bundle does not prerequisite objects' '
335335
test_expect_success 'bundle should be able to create a full history' '
336336
337337
cd "$D" &&
338-
git tag -a -m '1.0' v1.0 master &&
338+
git tag -a -m "1.0" v1.0 master &&
339339
git bundle create bundle4 v1.0
340340
341341
'

0 commit comments

Comments
 (0)