Skip to content

Commit 7a13547

Browse files
committed
Merge branch 'es/test-fixes'
Test clean-up and corrections. * es/test-fixes: (26 commits) t5608: fix broken &&-chain t9119: fix broken &&-chains t9000-t9999: fix broken &&-chains t7000-t7999: fix broken &&-chains t6000-t6999: fix broken &&-chains t5000-t5999: fix broken &&-chains t4000-t4999: fix broken &&-chains t3030: fix broken &&-chains t3000-t3999: fix broken &&-chains t2000-t2999: fix broken &&-chains t1000-t1999: fix broken &&-chains t0000-t0999: fix broken &&-chains t9814: simplify convoluted check that command correctly errors out t9001: fix broken "invoke hook" test t7810: use test_expect_code() instead of hand-rolled comparison t7400: fix broken "submodule add/reconfigure --force" test t7201: drop pointless "exit 0" at end of subshell t6036: fix broken "merge fails but has appropriate contents" tests t5505: modernize and simplify hard-to-digest test t5406: use write_script() instead of birthing shell script manually ...
2 parents b006f01 + 9500526 commit 7a13547

File tree

104 files changed

+569
-590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+569
-590
lines changed

t/lib-submodule-update.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ test_submodule_recursing_with_args_common() {
756756
: >sub1/untrackedfile &&
757757
test_must_fail $command replace_sub1_with_file &&
758758
test_superproject_content origin/add_sub1 &&
759-
test_submodule_content sub1 origin/add_sub1
759+
test_submodule_content sub1 origin/add_sub1 &&
760760
test -f sub1/untracked_file
761761
)
762762
'
@@ -844,7 +844,7 @@ test_submodule_switch_recursing_with_args () {
844844
cd submodule_update &&
845845
git branch -t add_sub1 origin/add_sub1 &&
846846
: >sub1 &&
847-
echo sub1 >.git/info/exclude
847+
echo sub1 >.git/info/exclude &&
848848
$command add_sub1 &&
849849
test_superproject_content origin/add_sub1 &&
850850
test_submodule_content sub1 origin/add_sub1
@@ -971,7 +971,6 @@ test_submodule_forced_switch_recursing_with_args () {
971971
rm -rf .git/modules/sub1 &&
972972
$command replace_sub1_with_directory &&
973973
test_superproject_content origin/replace_sub1_with_directory &&
974-
test_submodule_content sub1 origin/modify_sub1
975974
test_git_directory_exists sub1
976975
)
977976
'

t/t0000-basic.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ test_expect_success 'very long name in the index handled sanely' '
10811081
(
10821082
git ls-files -s path4 |
10831083
sed -e "s/ .*/ /" |
1084-
tr -d "\012"
1084+
tr -d "\012" &&
10851085
echo "$a"
10861086
) | git update-index --index-info &&
10871087
len=$(git ls-files "a*" | wc -c) &&

t/t0001-init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ is_hidden () {
408408
test_expect_success MINGW '.git hidden' '
409409
rm -rf newdir &&
410410
(
411-
unset GIT_DIR GIT_WORK_TREE
411+
sane_unset GIT_DIR GIT_WORK_TREE &&
412412
mkdir newdir &&
413413
cd newdir &&
414414
git init &&
@@ -420,7 +420,7 @@ test_expect_success MINGW '.git hidden' '
420420
test_expect_success MINGW 'bare git dir not hidden' '
421421
rm -rf newdir &&
422422
(
423-
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
423+
sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG &&
424424
mkdir newdir &&
425425
cd newdir &&
426426
git --bare init

t/t0003-attributes.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ test_expect_success 'open-quoted pathname' '
3434
test_expect_success 'setup' '
3535
mkdir -p a/b/d a/c b &&
3636
(
37-
echo "[attr]notest !test"
38-
echo "\" d \" test=d"
39-
echo " e test=e"
40-
echo " e\" test=e"
41-
echo "f test=f"
42-
echo "a/i test=a/i"
43-
echo "onoff test -test"
44-
echo "offon -test test"
45-
echo "no notest"
37+
echo "[attr]notest !test" &&
38+
echo "\" d \" test=d" &&
39+
echo " e test=e" &&
40+
echo " e\" test=e" &&
41+
echo "f test=f" &&
42+
echo "a/i test=a/i" &&
43+
echo "onoff test -test" &&
44+
echo "offon -test test" &&
45+
echo "no notest" &&
4646
echo "A/e/F test=A/e/F"
4747
) >.gitattributes &&
4848
(
@@ -51,7 +51,7 @@ test_expect_success 'setup' '
5151
) >a/.gitattributes &&
5252
(
5353
echo "h test=a/b/h" &&
54-
echo "d/* test=a/b/d/*"
54+
echo "d/* test=a/b/d/*" &&
5555
echo "d/yes notest"
5656
) >a/b/.gitattributes &&
5757
(
@@ -287,7 +287,7 @@ test_expect_success 'bare repository: check that .gitattribute is ignored' '
287287
(
288288
cd bare.git &&
289289
(
290-
echo "f test=f"
290+
echo "f test=f" &&
291291
echo "a/i test=a/i"
292292
) >.gitattributes &&
293293
attr_check f unspecified &&
@@ -312,7 +312,7 @@ test_expect_success 'bare repository: test info/attributes' '
312312
(
313313
cd bare.git &&
314314
(
315-
echo "f test=f"
315+
echo "f test=f" &&
316316
echo "a/i test=a/i"
317317
) >info/attributes &&
318318
attr_check f f &&

t/t0021-conversion.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ test_expect_success PERL 'missing file in delayed checkout' '
785785
cd repo &&
786786
git init &&
787787
echo "*.a filter=bug" >.gitattributes &&
788-
cp "$TEST_ROOT/test.o" missing-delay.a
788+
cp "$TEST_ROOT/test.o" missing-delay.a &&
789789
git add . &&
790790
git commit -m "test commit"
791791
) &&
@@ -807,7 +807,7 @@ test_expect_success PERL 'invalid file in delayed checkout' '
807807
git init &&
808808
echo "*.a filter=bug" >.gitattributes &&
809809
cp "$TEST_ROOT/test.o" invalid-delay.a &&
810-
cp "$TEST_ROOT/test.o" unfiltered
810+
cp "$TEST_ROOT/test.o" unfiltered &&
811811
git add . &&
812812
git commit -m "test commit"
813813
) &&

t/t0090-cache-tree.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ test_expect_success PERL 'commit --interactive gives cache-tree on partial commi
156156
return 44;
157157
}
158158
EOT
159-
(echo p; echo 1; echo; echo s; echo n; echo y; echo q) |
159+
test_write_lines p 1 "" s n y q |
160160
git commit --interactive -m foo &&
161161
test_cache_tree
162162
'

t/t1004-read-tree-m-u-wf.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ test_expect_success 'D/F' '
210210
read_tree_u_must_succeed -m -u branch-point side-b side-a &&
211211
git ls-files -u >actual &&
212212
(
213-
a=$(git rev-parse branch-point:subdir/file2)
214-
b=$(git rev-parse side-a:subdir/file2/another)
215-
echo "100644 $a 1 subdir/file2"
216-
echo "100644 $a 2 subdir/file2"
213+
a=$(git rev-parse branch-point:subdir/file2) &&
214+
b=$(git rev-parse side-a:subdir/file2/another) &&
215+
echo "100644 $a 1 subdir/file2" &&
216+
echo "100644 $a 2 subdir/file2" &&
217217
echo "100644 $b 3 subdir/file2/another"
218218
) >expect &&
219219
test_cmp expect actual

t/t1005-read-tree-reset.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test_expect_success 'reset should remove remnants from a failed merge' '
3333
git ls-files -s >expect &&
3434
sha1=$(git rev-parse :new) &&
3535
(
36-
echo "100644 $sha1 1 old"
36+
echo "100644 $sha1 1 old" &&
3737
echo "100644 $sha1 3 old"
3838
) | git update-index --index-info &&
3939
>old &&
@@ -48,7 +48,7 @@ test_expect_success 'two-way reset should remove remnants too' '
4848
git ls-files -s >expect &&
4949
sha1=$(git rev-parse :new) &&
5050
(
51-
echo "100644 $sha1 1 old"
51+
echo "100644 $sha1 1 old" &&
5252
echo "100644 $sha1 3 old"
5353
) | git update-index --index-info &&
5454
>old &&
@@ -63,7 +63,7 @@ test_expect_success 'Porcelain reset should remove remnants too' '
6363
git ls-files -s >expect &&
6464
sha1=$(git rev-parse :new) &&
6565
(
66-
echo "100644 $sha1 1 old"
66+
echo "100644 $sha1 1 old" &&
6767
echo "100644 $sha1 3 old"
6868
) | git update-index --index-info &&
6969
>old &&
@@ -78,7 +78,7 @@ test_expect_success 'Porcelain checkout -f should remove remnants too' '
7878
git ls-files -s >expect &&
7979
sha1=$(git rev-parse :new) &&
8080
(
81-
echo "100644 $sha1 1 old"
81+
echo "100644 $sha1 1 old" &&
8282
echo "100644 $sha1 3 old"
8383
) | git update-index --index-info &&
8484
>old &&
@@ -93,7 +93,7 @@ test_expect_success 'Porcelain checkout -f HEAD should remove remnants too' '
9393
git ls-files -s >expect &&
9494
sha1=$(git rev-parse :new) &&
9595
(
96-
echo "100644 $sha1 1 old"
96+
echo "100644 $sha1 1 old" &&
9797
echo "100644 $sha1 3 old"
9898
) | git update-index --index-info &&
9999
>old &&

t/t1008-read-tree-overlay.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test_expect_success setup '
2323

2424
test_expect_success 'multi-read' '
2525
read_tree_must_succeed initial master side &&
26-
(echo a; echo b/c) >expect &&
26+
test_write_lines a b/c >expect &&
2727
git ls-files >actual &&
2828
test_cmp expect actual
2929
'

t/t1020-subdirectory.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ test_expect_success 'GIT_PREFIX for built-ins' '
148148
(
149149
cd dir &&
150150
echo "change" >two &&
151-
GIT_EXTERNAL_DIFF=./diff git diff >../actual
151+
GIT_EXTERNAL_DIFF=./diff git diff >../actual &&
152152
git checkout -- two
153153
) &&
154154
test_cmp expect actual

0 commit comments

Comments
 (0)