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
This commit is contained in:
Junio C Hamano 2020-08-13 14:13:39 -07:00
Родитель d1a8a8979d 289218de2b
Коммит 0a41a89306
18 изменённых файлов: 53 добавлений и 80 удалений

Просмотреть файл

@ -324,7 +324,7 @@ test_expect_success "create $m (logged by config)" '
test_expect_success "update $m (logged by config)" '
test_config core.logAllRefUpdates true &&
GIT_COMMITTER_DATE="2005-05-26 23:33" \
git update-ref HEAD'" $B $A "'-m "Switch" &&
git update-ref HEAD $B $A -m "Switch" &&
test $B = $(git show-ref -s --verify $m)
'
test_expect_success "set $m (logged by config)" '

Просмотреть файл

@ -47,7 +47,7 @@ test_expect_success 'cherry-pick --nonsense' '
git diff --exit-code HEAD &&
test_must_fail git cherry-pick --nonsense 2>msg &&
git diff --exit-code HEAD "$pos" &&
test_i18ngrep '[Uu]sage:' msg
test_i18ngrep "[Uu]sage:" msg
'
test_expect_success 'revert --nonsense' '
@ -56,7 +56,7 @@ test_expect_success 'revert --nonsense' '
git diff --exit-code HEAD &&
test_must_fail git revert --nonsense 2>msg &&
git diff --exit-code HEAD "$pos" &&
test_i18ngrep '[Uu]sage:' msg
test_i18ngrep "[Uu]sage:" msg
'
test_expect_success 'cherry-pick after renaming branch' '

Просмотреть файл

@ -512,7 +512,7 @@ test_expect_success 'commit after failed cherry-pick adds -s at the right place'
Signed-off-by: C O Mitter <committer@example.com>
# Conflicts:
EOF
grep -e "^# Conflicts:" -e '^Signed-off-by' .git/COMMIT_EDITMSG >actual &&
grep -e "^# Conflicts:" -e "^Signed-off-by" .git/COMMIT_EDITMSG >actual &&
test_cmp expect actual &&
cat <<-\EOF >expected &&
@ -541,7 +541,7 @@ test_expect_success 'commit --amend -s places the sign-off at the right place' '
Signed-off-by: C O Mitter <committer@example.com>
Conflicts:
EOF
grep -e "^Conflicts:" -e '^Signed-off-by' .git/COMMIT_EDITMSG >actual &&
grep -e "^Conflicts:" -e "^Signed-off-by" .git/COMMIT_EDITMSG >actual &&
test_cmp expect actual
'

Просмотреть файл

@ -14,8 +14,8 @@ test_expect_success 'setup reference tree' '
git update-index --add COPYING rezrov &&
tree=$(git write-tree) &&
echo $tree &&
sed -e 's/HOWEVER/However/' <COPYING >COPYING.1 &&
sed -e 's/GPL/G.P.L/g' <COPYING >COPYING.2 &&
sed -e "s/HOWEVER/However/" <COPYING >COPYING.1 &&
sed -e "s/GPL/G.P.L/g" <COPYING >COPYING.2 &&
origoid=$(git hash-object COPYING) &&
oid1=$(git hash-object COPYING.1) &&
oid2=$(git hash-object COPYING.2)

Просмотреть файл

@ -102,7 +102,7 @@ test_expect_success 'word diff with runs of whitespace' '
'
test_expect_success '--word-diff=porcelain' '
sed 's/#.*$//' >expect <<-EOF &&
sed "s/#.*$//" >expect <<-EOF &&
diff --git a/pre b/post
index $pre..$post 100644
--- a/pre

Просмотреть файл

@ -3,80 +3,55 @@
# Copyright (c) 2005 Junio C Hamano
#
test_description='git apply boundary tests
test_description='git apply boundary tests'
'
. ./test-lib.sh
L="c d e f g h i j k l m n o p q r s t u v w x"
test_expect_success setup '
for i in b '"$L"' y
do
echo $i
done >victim &&
test_write_lines b $L y >victim &&
cat victim >original &&
git update-index --add victim &&
# add to the head
for i in a b '"$L"' y
do
echo $i
done >victim &&
test_write_lines a b $L y >victim &&
cat victim >add-a-expect &&
git diff victim >add-a-patch.with &&
git diff --unified=0 >add-a-patch.without &&
# insert at line two
for i in b a '"$L"' y
do
echo $i
done >victim &&
test_write_lines b a $L y >victim &&
cat victim >insert-a-expect &&
git diff victim >insert-a-patch.with &&
git diff --unified=0 >insert-a-patch.without &&
# modify at the head
for i in a '"$L"' y
do
echo $i
done >victim &&
test_write_lines a $L y >victim &&
cat victim >mod-a-expect &&
git diff victim >mod-a-patch.with &&
git diff --unified=0 >mod-a-patch.without &&
# remove from the head
for i in '"$L"' y
do
echo $i
done >victim &&
test_write_lines $L y >victim &&
cat victim >del-a-expect &&
git diff victim >del-a-patch.with &&
git diff --unified=0 >del-a-patch.without &&
# add to the tail
for i in b '"$L"' y z
do
echo $i
done >victim &&
test_write_lines b $L y z >victim &&
cat victim >add-z-expect &&
git diff victim >add-z-patch.with &&
git diff --unified=0 >add-z-patch.without &&
# modify at the tail
for i in b '"$L"' z
do
echo $i
done >victim &&
test_write_lines b $L z >victim &&
cat victim >mod-z-expect &&
git diff victim >mod-z-patch.with &&
git diff --unified=0 >mod-z-patch.without &&
# remove from the tail
for i in b '"$L"'
do
echo $i
done >victim &&
test_write_lines b $L >victim &&
cat victim >del-z-expect &&
git diff victim >del-z-patch.with &&
git diff --unified=0 >del-z-patch.without
@ -88,15 +63,15 @@ for with in with without
do
case "$with" in
with) u= ;;
without) u='--unidiff-zero ' ;;
without) u=--unidiff-zero ;;
esac
for kind in add-a add-z insert-a mod-a mod-z del-a del-z
do
test_expect_success "apply $kind-patch $with context" '
cat original >victim &&
git update-index victim &&
git apply --index '"$u$kind-patch.$with"' &&
test_cmp '"$kind"'-expect victim
git apply --index $u "$kind-patch.$with" &&
test_cmp "$kind-expect" victim
'
done
done
@ -110,13 +85,12 @@ do
test_expect_success "apply non-git $kind-patch without context" '
cat original >victim &&
git update-index victim &&
git apply --unidiff-zero --index '"$kind-ng.without"' &&
test_cmp '"$kind"'-expect victim
git apply --unidiff-zero --index "$kind-ng.without" &&
test_cmp "$kind-expect" victim
'
done
test_expect_success 'two lines' '
>file &&
git add file &&
echo aaa >file &&
@ -125,11 +99,10 @@ test_expect_success 'two lines' '
echo bbb >file &&
git add file &&
test_must_fail git apply --check patch
'
test_expect_success 'apply patch with 3 context lines matching at end' '
{ echo a; echo b; echo c; echo d; } >file &&
test_write_lines a b c d >file &&
git add file &&
echo e >>file &&
git diff >patch &&

Просмотреть файл

@ -989,7 +989,7 @@ test_expect_success 'am -s unexpected trailer block' '
Signed-off-by: J C H <j@c.h>
EOF
git commit -F msg &&
git cat-file commit HEAD | sed -e '1,/^$/d' >original &&
git cat-file commit HEAD | sed -e "1,/^$/d" >original &&
git format-patch --stdout -1 >patch &&
git reset --hard HEAD^ &&
@ -998,7 +998,7 @@ test_expect_success 'am -s unexpected trailer block' '
cat original &&
echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
) >expect &&
git cat-file commit HEAD | sed -e '1,/^$/d' >actual &&
git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
test_cmp expect actual &&
cat >msg <<-\EOF &&
@ -1009,7 +1009,7 @@ test_expect_success 'am -s unexpected trailer block' '
EOF
git reset HEAD^ &&
git commit -F msg file &&
git cat-file commit HEAD | sed -e '1,/^$/d' >original &&
git cat-file commit HEAD | sed -e "1,/^$/d" >original &&
git format-patch --stdout -1 >patch &&
git reset --hard HEAD^ &&
@ -1020,7 +1020,7 @@ test_expect_success 'am -s unexpected trailer block' '
echo &&
echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
) >expect &&
git cat-file commit HEAD | sed -e '1,/^$/d' >actual &&
git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
test_cmp expect actual
'

Просмотреть файл

@ -363,7 +363,7 @@ test_expect_success 'set up an unresolved merge' '
git reset --hard &&
git checkout version2 &&
fifth=$(git rev-parse fifth) &&
echo "$fifth branch 'fifth' of ." |
echo "$fifth branch fifth of ." |
git fmt-merge-msg >msg &&
ancestor=$(git merge-base version2 fifth) &&
test_must_fail git merge-recursive "$ancestor" -- HEAD fifth &&

Просмотреть файл

@ -14,7 +14,7 @@ test_expect_success 'setup' '
i=1 &&
while test $i -le 100
do
iii=$(printf '%03i' $i)
iii=$(printf "%03i" $i)
test-tool genrandom "bar" 200 > wide_delta_$iii &&
test-tool genrandom "baz $iii" 50 >> wide_delta_$iii &&
test-tool genrandom "foo"$i 100 > deep_delta_$iii &&

Просмотреть файл

@ -213,7 +213,7 @@ test_expect_success 'fetch tags when there is no tags' '
test_expect_success 'fetch following tags' '
cd "$D" &&
git tag -a -m 'annotated' anno HEAD &&
git tag -a -m "annotated" anno HEAD &&
git tag light HEAD &&
mkdir four &&
@ -335,7 +335,7 @@ test_expect_success 'bundle does not prerequisite objects' '
test_expect_success 'bundle should be able to create a full history' '
cd "$D" &&
git tag -a -m '1.0' v1.0 master &&
git tag -a -m "1.0" v1.0 master &&
git bundle create bundle4 v1.0
'

Просмотреть файл

@ -81,7 +81,7 @@ test_expect_success 'fetch --set-upstream http://nosuchdomain.example.com fails
test_expect_success 'fetch --set-upstream with valid URL sets upstream to URL' '
clear_config other other2 &&
url="file://'"$PWD"'" &&
url="file://$PWD" &&
git fetch --set-upstream "$url" &&
check_config master "$url" HEAD &&
check_config_missing other &&
@ -158,7 +158,7 @@ test_expect_success 'pull --set-upstream upstream with more than one branch does
test_expect_success 'pull --set-upstream with valid URL sets upstream to URL' '
clear_config master other other2 &&
git checkout master &&
url="file://'"$PWD"'" &&
url="file://$PWD" &&
git pull --set-upstream "$url" &&
check_config master "$url" HEAD &&
check_config_missing other &&
@ -168,7 +168,7 @@ test_expect_success 'pull --set-upstream with valid URL sets upstream to URL' '
test_expect_success 'pull --set-upstream with valid URL and branch sets branch' '
clear_config master other other2 &&
git checkout master &&
url="file://'"$PWD"'" &&
url="file://$PWD" &&
git pull --set-upstream "$url" master &&
check_config master "$url" refs/heads/master &&
check_config_missing other &&

Просмотреть файл

@ -122,7 +122,7 @@ test_expect_success 'custom merge backend' '
o=$(git unpack-file master^:text) &&
a=$(git unpack-file side^:text) &&
b=$(git unpack-file master:text) &&
sh -c "./custom-merge $o $a $b 0 'text'" &&
sh -c "./custom-merge $o $a $b 0 text" &&
sed -e 1,3d $a >check-2 &&
cmp check-1 check-2 &&
rm -f $o $a $b
@ -149,7 +149,7 @@ test_expect_success 'custom merge backend' '
o=$(git unpack-file master^:text) &&
a=$(git unpack-file anchor:text) &&
b=$(git unpack-file master:text) &&
sh -c "./custom-merge $o $a $b 0 'text'" &&
sh -c "./custom-merge $o $a $b 0 text" &&
sed -e 1,3d $a >check-2 &&
cmp check-1 check-2 &&
sed -e 1,3d -e 4q $a >check-3 &&

Просмотреть файл

@ -177,7 +177,7 @@ test_expect_success "Sergey Vlasov's test case" '
date >ab.c &&
date >ab/d &&
git add ab.c ab &&
git commit -m 'initial' &&
git commit -m "initial" &&
git mv ab a
'

Просмотреть файл

@ -246,7 +246,7 @@ test_expect_success 'merge --squash c3 with c7' '
# file
EOF
git cat-file commit HEAD >raw &&
sed -e '1,/^$/d' raw >actual &&
sed -e "1,/^$/d" raw >actual &&
test_cmp expect actual
'
@ -268,7 +268,7 @@ test_expect_success 'merge c3 with c7 with commit.cleanup = scissors' '
# file
EOF
git cat-file commit HEAD >raw &&
sed -e '1,/^$/d' raw >actual &&
sed -e "1,/^$/d" raw >actual &&
test_i18ncmp expect actual
'
@ -292,7 +292,7 @@ test_expect_success 'merge c3 with c7 with --squash commit.cleanup = scissors' '
# file
EOF
git cat-file commit HEAD >raw &&
sed -e '1,/^$/d' raw >actual &&
sed -e "1,/^$/d" raw >actual &&
test_i18ncmp expect actual
'

Просмотреть файл

@ -1551,7 +1551,7 @@ test_expect_success $PREREQ '8-bit and sendemail.transferencoding=quoted-printab
--smtp-server="$(pwd)/fake.sendmail" \
email-using-8bit \
2>errors >out &&
sed '1,/^$/d' msgtxt1 >actual &&
sed "1,/^$/d" msgtxt1 >actual &&
test_cmp expected actual
'
@ -1568,7 +1568,7 @@ test_expect_success $PREREQ '8-bit and sendemail.transferencoding=base64' '
--smtp-server="$(pwd)/fake.sendmail" \
email-using-8bit \
2>errors >out &&
sed '1,/^$/d' msgtxt1 >actual &&
sed "1,/^$/d" msgtxt1 >actual &&
test_cmp expected actual
'
@ -1594,7 +1594,7 @@ test_expect_success $PREREQ 'convert from quoted-printable to base64' '
--smtp-server="$(pwd)/fake.sendmail" \
email-using-qp \
2>errors >out &&
sed '1,/^$/d' msgtxt1 >actual &&
sed "1,/^$/d" msgtxt1 >actual &&
test_cmp expected actual
'
@ -1624,7 +1624,7 @@ test_expect_success $PREREQ 'CRLF and sendemail.transferencoding=quoted-printabl
--smtp-server="$(pwd)/fake.sendmail" \
email-using-crlf \
2>errors >out &&
sed '1,/^$/d' msgtxt1 >actual &&
sed "1,/^$/d" msgtxt1 >actual &&
test_cmp expected actual
'
@ -1641,7 +1641,7 @@ test_expect_success $PREREQ 'CRLF and sendemail.transferencoding=base64' '
--smtp-server="$(pwd)/fake.sendmail" \
email-using-crlf \
2>errors >out &&
sed '1,/^$/d' msgtxt1 >actual &&
sed "1,/^$/d" msgtxt1 >actual &&
test_cmp expected actual
'

Просмотреть файл

@ -63,16 +63,16 @@ test_expect_success "$name" '
name='detect node change from file to directory #1'
test_expect_success "$name" "
test_expect_success "$name" '
mkdir dir/new_file &&
mv dir/file dir/new_file/file &&
mv dir/new_file dir/file &&
git update-index --remove dir/file &&
git update-index --add dir/file/file &&
git commit -m '$name' &&
git commit -m "$name" &&
test_must_fail git svn set-tree --find-copies-harder --rmdir \
remotes/git-svn..mybranch
"
'
name='detect node change from directory to file #1'

Просмотреть файл

@ -167,10 +167,10 @@ test_expect_success 'adding files' '
test_expect_success 'updating' '
git pull gitcvs.git &&
echo 'hi' > subdir/newfile.bin &&
echo 'junk' > subdir/file.h &&
echo 'hi' > subdir/newfile.c &&
echo 'hello' >> binfile.bin &&
echo "hi" >subdir/newfile.bin &&
echo "junk" >subdir/file.h &&
echo "hi" >subdir/newfile.c &&
echo "hello" >>binfile.bin &&
git add subdir/newfile.bin subdir/file.h subdir/newfile.c binfile.bin &&
git commit -q -m "Add and change some files" &&
git push gitcvs.git >/dev/null &&

Просмотреть файл

@ -178,7 +178,7 @@ test_expect_success 'setup v1.2 on b1' '
mkdir cdir &&
echo "cdir/cfile" >cdir/cfile &&
git add -A cdir adir t3 t2 &&
git commit -q -m 'v1.2' &&
git commit -q -m "v1.2" &&
git tag v1.2 &&
git push --tags gitcvs.git b1:b1
'