Various test scripts have been updated for style and also correct
handling of exit status of various commands.
* md/test-cleanup:
tests: order arguments to git-rev-list properly
t9109: don't swallow Git errors upstream of pipes
tests: don't swallow Git errors upstream of pipes
t/*: fix ordering of expected/observed arguments
tests: standardize pipe placement
Documentation: add shell guidelines
t/README: reformat Do, Don't, Keep in mind lists
@ -1097,7 +1097,7 @@ test_expect_success 'validate git diff-files output for a know cache/work tree s
@@ -1097,7 +1097,7 @@ test_expect_success 'validate git diff-files output for a know cache/work tree s
:120000 120000 $(test_oid subp3s) $ZERO_OID M path3/subp3/file3sym
EOF
git diff-files >current &&
test_cmp current expected
test_cmp expected current
'
test_expect_success 'git update-index --refresh should succeed' '
test_expect_success "--batch for an existent and a non-existent hash" '
@ -229,8 +229,8 @@ test_expect_success "--batch for an existent and a non-existent hash" '
@@ -229,8 +229,8 @@ test_expect_success "--batch for an existent and a non-existent hash" '
@ -44,7 +44,7 @@ test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '
@@ -44,7 +44,7 @@ test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '
git config core.notesRef refs/notes/y &&
test_must_fail git notes merge z &&
echo "ref: refs/notes/y" >expect &&
test_cmp .git/NOTES_MERGE_REF expect
test_cmp expect .git/NOTES_MERGE_REF
'
test_expect_success 'merge z into y while mid-merge in another workdir fails' '
@ -66,7 +66,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '
@@ -66,7 +66,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '
grep -v "A notes merge into refs/notes/x is already in-progress in" out
@ -55,7 +55,7 @@ test_expect_success 'blank line at end of file; extend at end of file' '
@@ -55,7 +55,7 @@ test_expect_success 'blank line at end of file; extend at end of file' '
git add file && git commit -m second &&
git rebase --whitespace=fix HEAD^^ &&
git diff --exit-code HEAD^:file expect-first &&
test_cmp file expect-second
test_cmp expect-second file
'
# prepare third revision of "file"
@ -82,7 +82,7 @@ test_expect_success 'two blanks line at end of file; extend at end of file' '
@@ -82,7 +82,7 @@ test_expect_success 'two blanks line at end of file; extend at end of file' '
cp third file && git add file && git commit -m third &&
git rebase --whitespace=fix HEAD^^ &&
git diff --exit-code HEAD^:file expect-second &&
test_cmp file expect-third
test_cmp expect-third file
'
test_expect_success 'same, but do not remove trailing spaces' '
@ -120,7 +120,7 @@ test_expect_success 'at beginning of file' '
@@ -120,7 +120,7 @@ test_expect_success 'at beginning of file' '
@ -37,7 +37,7 @@ test_expect_success 'hunk header truncation with an overly long line' '
@@ -37,7 +37,7 @@ test_expect_success 'hunk header truncation with an overly long line' '
@ -72,7 +72,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
@@ -72,7 +72,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
rm -f file1.rej file2.rej &&
test_must_fail git apply --reject patch.1 &&
test_cmp file1 expected &&
test_cmp expected file1 &&
cat file1.rej &&
test_path_is_missing file2.rej
@ -85,7 +85,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
@@ -85,7 +85,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
test_expect_success 'tons of blanks at EOF should not apply' '
@ -342,10 +342,10 @@ test_expect_success 'missing blank line at end with --whitespace=fix' '
@@ -342,10 +342,10 @@ test_expect_success 'missing blank line at end with --whitespace=fix' '
test_expect_success 'two missing blank lines at end with --whitespace=fix' '
@ -360,11 +360,11 @@ test_expect_success 'two missing blank lines at end with --whitespace=fix' '
@@ -360,11 +360,11 @@ test_expect_success 'two missing blank lines at end with --whitespace=fix' '
test_expect_success 'missing blank line at end, insert before end, --whitespace=fix' '
@ -376,7 +376,7 @@ test_expect_success 'missing blank line at end, insert before end, --whitespace=
@@ -376,7 +376,7 @@ test_expect_success 'missing blank line at end, insert before end, --whitespace=
echo a >one &&
test_must_fail git apply patch &&
git apply --whitespace=fix patch &&
test_cmp one expect
test_cmp expect one
'
test_expect_success 'shrink file with tons of missing blanks at end of file' '
@ -392,10 +392,10 @@ test_expect_success 'shrink file with tons of missing blanks at end of file' '
@@ -392,10 +392,10 @@ test_expect_success 'shrink file with tons of missing blanks at end of file' '
test_expect_success 'missing blanks at EOF must only match blank lines' '
@ -427,7 +427,7 @@ test_expect_success 'missing blank line should match context line with spaces' '
@@ -427,7 +427,7 @@ test_expect_success 'missing blank line should match context line with spaces' '
git add one &&
git apply --whitespace=fix patch &&
test_cmp one expect
test_cmp expect one
'
sed -e's/Z//' >one <<EOF
@ -447,7 +447,7 @@ test_expect_success 'same, but with the --ignore-space-option' '
@@ -447,7 +447,7 @@ test_expect_success 'same, but with the --ignore-space-option' '
test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '
@ -464,7 +464,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '
@@ -464,7 +464,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '
@ -109,7 +114,8 @@ test_expect_success 'push new commits to server for file.2.txt' '
@@ -109,7 +114,8 @@ test_expect_success 'push new commits to server for file.2.txt' '
# Verify we have all the new blobs.
test_expect_success 'override inherited filter-spec using --no-filter' '
@ -130,16 +136,22 @@ test_expect_success 'push new commits to server for file.3.txt' '
@@ -130,16 +136,22 @@ test_expect_success 'push new commits to server for file.3.txt' '
# perhaps combined with a command in dry-run mode.
test_expect_success 'manual prefetch of missing objects' '
@ -194,7 +206,7 @@ test_expect_success 'upon cloning, check that all refs point to objects' '
@@ -194,7 +206,7 @@ test_expect_success 'upon cloning, check that all refs point to objects' '
test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '
@ -42,7 +42,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol
@@ -42,7 +42,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol
test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '
@ -151,7 +151,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol
@@ -151,7 +151,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol
test_expect_success 'server-options are sent when using ls-remote' '
@ -164,7 +164,7 @@ test_expect_success 'server-options are sent when using ls-remote' '
@@ -164,7 +164,7 @@ test_expect_success 'server-options are sent when using ls-remote' '
@ -148,7 +148,7 @@ test_expect_success PERL 'import from a CVS working tree' '
@@ -148,7 +148,7 @@ test_expect_success PERL 'import from a CVS working tree' '
@ -29,11 +29,11 @@ test_expect_failure PERL 'import with criss cross times on revisions' '
@@ -29,11 +29,11 @@ test_expect_failure PERL 'import with criss cross times on revisions' '
Rev 3
Rev 2
Rev 1" > expect-master &&
test_cmp actual-master expect-master &&
test_cmp expect-master actual-master &&
echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&