]> git.ipfire.org Git - thirdparty/git.git/commitdiff
tests: add missing &&, batch 2
authorJonathan Nieder <jrnieder@gmail.com>
Sun, 31 Oct 2010 07:30:58 +0000 (02:30 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Nov 2010 22:45:22 +0000 (14:45 -0800)
Same rules as before: this patch only adds " &&" to the end of
some lines in the test suite.

Intended to be applied on top of or squashed with the last
batch if they look okay.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 files changed:
t/t0020-crlf.sh
t/t1400-update-ref.sh
t/t3301-notes.sh
t/t3404-rebase-interactive.sh
t/t4124-apply-ws-rule.sh
t/t5503-tagfollow.sh
t/t5701-clone-local.sh
t/t7001-mv.sh
t/t7004-tag.sh
t/t7300-clean.sh
t/t7502-commit.sh
t/t7700-repack.sh
t/t9146-git-svn-empty-dirs.sh

index 234a94f3e6311c529b5bb476ee5a6a2ea705017f..1a8f44c44ca3cce70990ec56fec61894be9b3086 100755 (executable)
@@ -439,7 +439,7 @@ test_expect_success 'checkout when deleting .gitattributes' '
        git rm .gitattributes &&
        echo "contentsQ" | q_to_cr > .file2 &&
        git add .file2 &&
-       git commit -m third
+       git commit -m third &&
 
        git checkout master~1 &&
        git checkout master &&
index 54ba3df95f66ecc060adaec6846877c793016aa1..d17551eb724a4deb4e682dcfba5a885d5a839ce2 100755 (executable)
@@ -185,55 +185,55 @@ gd="Thu, 26 May 2005 18:33:00 -0500"
 ld="Thu, 26 May 2005 18:43:00 -0500"
 test_expect_success \
        'Query "master@{May 25 2005}" (before history)' \
-       'rm -f o e
+       'rm -f o e &&
         git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
         test '"$C"' = $(cat o) &&
         test "warning: Log for '\'master\'' only goes back to $ed." = "$(cat e)"'
 test_expect_success \
        "Query master@{2005-05-25} (before history)" \
-       'rm -f o e
+       'rm -f o e &&
         git rev-parse --verify master@{2005-05-25} >o 2>e &&
         test '"$C"' = $(cat o) &&
         echo test "warning: Log for '\'master\'' only goes back to $ed." = "$(cat e)"'
 test_expect_success \
        'Query "master@{May 26 2005 23:31:59}" (1 second before history)' \
-       'rm -f o e
+       'rm -f o e &&
         git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
         test '"$C"' = $(cat o) &&
         test "warning: Log for '\''master'\'' only goes back to $ed." = "$(cat e)"'
 test_expect_success \
        'Query "master@{May 26 2005 23:32:00}" (exactly history start)' \
-       'rm -f o e
+       'rm -f o e &&
         git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
         test '"$C"' = $(cat o) &&
         test "" = "$(cat e)"'
 test_expect_success \
        'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' \
-       'rm -f o e
+       'rm -f o e &&
         git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
         test '"$A"' = $(cat o) &&
         test "" = "$(cat e)"'
 test_expect_success \
        'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' \
-       'rm -f o e
+       'rm -f o e &&
         git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
         test '"$B"' = $(cat o) &&
         test "warning: Log .git/logs/'"$m has gap after $gd"'." = "$(cat e)"'
 test_expect_success \
        'Query "master@{2005-05-26 23:38:00}" (middle of history)' \
-       'rm -f o e
+       'rm -f o e &&
         git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
         test '"$Z"' = $(cat o) &&
         test "" = "$(cat e)"'
 test_expect_success \
        'Query "master@{2005-05-26 23:43:00}" (exact end of history)' \
-       'rm -f o e
+       'rm -f o e &&
         git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
         test '"$E"' = $(cat o) &&
         test "" = "$(cat e)"'
 test_expect_success \
        'Query "master@{2005-05-28}" (past end of history)' \
-       'rm -f o e
+       'rm -f o e &&
         git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
         test '"$D"' = $(cat o) &&
         test "warning: Log .git/logs/'"$m unexpectedly ended on $ld"'." = "$(cat e)"'
@@ -247,7 +247,7 @@ test_expect_success \
      git add F &&
         GIT_AUTHOR_DATE="2005-05-26 23:30" \
         GIT_COMMITTER_DATE="2005-05-26 23:30" git commit -m add -a &&
-        h_TEST=$(git rev-parse --verify HEAD)
+        h_TEST=$(git rev-parse --verify HEAD) &&
         echo The other day this did not work. >M &&
         echo And then Bob told me how to fix it. >>M &&
         echo OTHER >F &&
index a2b79a0430b2468241a578aaad479a09db774dd5..69311713d71f669be643cd0dcdfc9bd5b9682d40 100755 (executable)
@@ -627,16 +627,16 @@ test_expect_success '--show-notes=ref accumulates' '
 
 test_expect_success 'Allow notes on non-commits (trees, blobs, tags)' '
        git config core.notesRef refs/notes/other &&
-       echo "Note on a tree" > expect
+       echo "Note on a tree" > expect &&
        git notes add -m "Note on a tree" HEAD: &&
        git notes show HEAD: > actual &&
        test_cmp expect actual &&
-       echo "Note on a blob" > expect
+       echo "Note on a blob" > expect &&
        filename=$(git ls-tree --name-only HEAD | head -n1) &&
        git notes add -m "Note on a blob" HEAD:$filename &&
        git notes show HEAD:$filename > actual &&
        test_cmp expect actual &&
-       echo "Note on a tag" > expect
+       echo "Note on a tag" > expect &&
        git tag -a -m "This is an annotated tag" foobar HEAD^ &&
        git notes add -m "Note on a tag" foobar &&
        git notes show foobar > actual &&
index 7d20a74c5ca1331ff241d1596bcb114e48a5907d..c0e69f61b3f03e40ade613da8e9ca4256206653a 100755 (executable)
@@ -46,7 +46,7 @@ test_expect_success 'setup' '
        test_commit G file1 &&
        test_commit H file5 &&
        git checkout -b branch2 F &&
-       test_commit I file6
+       test_commit I file6 &&
        git checkout -b conflict-branch A &&
        for n in one two three four
        do
@@ -584,7 +584,7 @@ test_expect_success 'do "noop" when there is nothing to cherry-pick' '
 
        git checkout -b branch4 HEAD &&
        GIT_EDITOR=: git commit --amend \
-               --author="Somebody else <somebody@else.com>" 
+               --author="Somebody else <somebody@else.com>" &&
        test $(git rev-parse branch3) != $(git rev-parse branch4) &&
        git rebase -i branch3 &&
        test $(git rev-parse branch3) = $(git rev-parse branch4)
@@ -599,7 +599,7 @@ test_expect_success 'submodule rebase setup' '
                git add elif && git commit -m "submodule initial"
        ) &&
        echo 1 >file1 &&
-       git add file1 sub
+       git add file1 sub &&
        test_tick &&
        git commit -m "One" &&
        echo 2 >file1 &&
index 8a676a5dcd113418c2bd4ea4aa885fddd5951a3a..414b09b2b3d820852c86d0fa80d648417ca76f21 100755 (executable)
@@ -368,7 +368,7 @@ test_expect_success 'missing blanks at EOF must only match blank lines' '
        git diff -- one >patch &&
 
        echo a >one &&
-       test_must_fail git apply patch
+       test_must_fail git apply patch &&
        test_must_fail git apply --whitespace=fix patch &&
        test_must_fail git apply --ignore-space-change --whitespace=fix patch
 '
@@ -419,7 +419,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '
        printf "b\r\n" >>one &&
        printf "c\r\n" >>one &&
        cp one save-one &&
-       printf "                 \r\n" >>one
+       printf "                 \r\n" >>one &&
        git add one &&
        printf "d\r\n" >>one &&
        cp one expect &&
@@ -436,7 +436,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol unset' '
        printf "b\r\n" >>one &&
        printf "c\r\n" >>one &&
        cp one save-one &&
-       printf "                 \r\n" >>one
+       printf "                 \r\n" >>one &&
        git add one &&
        cp one expect &&
        printf "d\r\n" >>one &&
index 8a298a655fa007fbd9a43d6212b53f749c980eb6..7f6d3d2f6cfdc9b56f87348639f9128304fb2cb0 100755 (executable)
@@ -54,7 +54,7 @@ EOF
 '
 
 test_expect_success NOT_MINGW 'fetch A (new commit : 1 connection)' '
-       rm -f $U
+       rm -f $U &&
        (
                cd cloned &&
                GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
@@ -87,7 +87,7 @@ EOF
 '
 
 test_expect_success NOT_MINGW 'fetch C, T (new branch, tag : 1 connection)' '
-       rm -f $U
+       rm -f $U &&
        (
                cd cloned &&
                GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
@@ -126,7 +126,7 @@ EOF
 '
 
 test_expect_success NOT_MINGW 'fetch B, S (commit and tag : 1 connection)' '
-       rm -f $U
+       rm -f $U &&
        (
                cd cloned &&
                GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
index 8b4c356cd21846025d84a434077bfdc8ee2bab57..0f4d487be34d22820bcc63619e6e85b96f18c609 100755 (executable)
@@ -10,11 +10,11 @@ test_expect_success 'preparing origin repository' '
        git clone --bare . a.git &&
        git clone --bare . x &&
        test "$(GIT_CONFIG=a.git/config git config --bool core.bare)" = true &&
-       test "$(GIT_CONFIG=x/config git config --bool core.bare)" = true
+       test "$(GIT_CONFIG=x/config git config --bool core.bare)" = true &&
        git bundle create b1.bundle --all &&
        git bundle create b2.bundle master &&
        mkdir dir &&
-       cp b1.bundle dir/b3
+       cp b1.bundle dir/b3 &&
        cp b1.bundle b4
 '
 
@@ -112,7 +112,7 @@ test_expect_success 'bundle clone with nonexistent HEAD' '
        cd "$D" &&
        git clone b2.bundle b2 &&
        cd b2 &&
-       git fetch
+       git fetch &&
        test ! -e .git/refs/heads/master
 '
 
index 624e6d25de0b978c839714c7abeeec563f3c42d8..a845b154e4db50b52eb67eaefefcc42403c52c0e 100755 (executable)
@@ -207,7 +207,7 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '
        git init &&
        echo 1 >dirty &&
        git add dirty &&
-       entry="$(git ls-files --stage dirty | cut -f 1)"
+       entry="$(git ls-files --stage dirty | cut -f 1)" &&
        git mv dirty dirty2 &&
        [ "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" ] &&
        echo 2 >dirty2 &&
index ac943f5eeecd17dd1edc5834265df9e16e5032f2..d05f4210f2577c43c4ebba5f5daae9598a4e255d 100755 (executable)
@@ -1097,7 +1097,7 @@ hash1=$(git rev-parse HEAD)
 test_expect_success 'creating second commit and tag' '
        echo foo-2.0 >foo &&
        git add foo &&
-       git commit -m second
+       git commit -m second &&
        git tag v2.0
 '
 
@@ -1122,18 +1122,18 @@ v2.0
 EOF
 
 test_expect_success 'checking that first commit is in all tags (hash)' "
-       git tag -l --contains $hash1 v* >actual
+       git tag -l --contains $hash1 v* >actual &&
        test_cmp expected actual
 "
 
 # other ways of specifying the commit
 test_expect_success 'checking that first commit is in all tags (tag)' "
-       git tag -l --contains v1.0 v* >actual
+       git tag -l --contains v1.0 v* >actual &&
        test_cmp expected actual
 "
 
 test_expect_success 'checking that first commit is in all tags (relative)' "
-       git tag -l --contains HEAD~2 v* >actual
+       git tag -l --contains HEAD~2 v* >actual &&
        test_cmp expected actual
 "
 
@@ -1142,7 +1142,7 @@ v2.0
 EOF
 
 test_expect_success 'checking that second commit only has one tag' "
-       git tag -l --contains $hash2 v* >actual
+       git tag -l --contains $hash2 v* >actual &&
        test_cmp expected actual
 "
 
@@ -1151,7 +1151,7 @@ cat > expected <<EOF
 EOF
 
 test_expect_success 'checking that third commit has no tags' "
-       git tag -l --contains $hash3 v* >actual
+       git tag -l --contains $hash3 v* >actual &&
        test_cmp expected actual
 "
 
@@ -1161,7 +1161,7 @@ test_expect_success 'creating simple branch' '
        git branch stable v2.0 &&
         git checkout stable &&
        echo foo-3.0 > foo &&
-       git commit foo -m fourth
+       git commit foo -m fourth &&
        git tag v3.0
 '
 
@@ -1172,7 +1172,7 @@ v3.0
 EOF
 
 test_expect_success 'checking that branch head only has one tag' "
-       git tag -l --contains $hash4 v* >actual
+       git tag -l --contains $hash4 v* >actual &&
        test_cmp expected actual
 "
 
@@ -1186,7 +1186,7 @@ v4.0
 EOF
 
 test_expect_success 'checking that original branch head has one tag now' "
-       git tag -l --contains $hash3 v* >actual
+       git tag -l --contains $hash3 v* >actual &&
        test_cmp expected actual
 "
 
@@ -1201,18 +1201,18 @@ v4.0
 EOF
 
 test_expect_success 'checking that initial commit is in all tags' "
-       git tag -l --contains $hash1 v* >actual
+       git tag -l --contains $hash1 v* >actual &&
        test_cmp expected actual
 "
 
 # mixing modes and options:
 
 test_expect_success 'mixing incompatibles modes and options is forbidden' '
-       test_must_fail git tag -a
-       test_must_fail git tag -l -v
-       test_must_fail git tag -n 100
-       test_must_fail git tag -l -m msg
-       test_must_fail git tag -l -F some file
+       test_must_fail git tag -a &&
+       test_must_fail git tag -l -v &&
+       test_must_fail git tag -n 100 &&
+       test_must_fail git tag -l -m msg &&
+       test_must_fail git tag -l -F some file &&
        test_must_fail git tag -v -s
 '
 
index 6c776e9bec78ab1cf960293d8c796e9de13045b5..c802ef826115cb130370a815ee1b15a5b10290ee 100755 (executable)
@@ -183,7 +183,7 @@ test_expect_success 'git clean symbolic link' '
 
        mkdir -p build docs &&
        touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
-       ln -s docs/manual.txt src/part4.c
+       ln -s docs/manual.txt src/part4.c &&
        git clean &&
        test -f Makefile &&
        test -f README &&
index c1c66450a395af91c54e7815ae7c21393f7fd2ad..50da034cd3934d0509e67a6f20e514a18e5659d4 100755 (executable)
@@ -390,7 +390,7 @@ try_commit_status_combo () {
 
        test_expect_success 'commit --no-status' '
                clear_config commit.status &&
-               try_commit --no-status
+               try_commit --no-status &&
                ! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
        '
 
index c2f66ff1703c35d5f5b92285e31e8df157e51642..d954b846a17d6374dd8c7dae7f901170ff3c8c24 100755 (executable)
@@ -56,7 +56,7 @@ test_expect_success 'loose objects in alternate ODB are not repacked' '
 '
 
 test_expect_success 'packed obs in alt ODB are repacked even when local repo is packless' '
-       mkdir alt_objects/pack
+       mkdir alt_objects/pack &&
        mv .git/objects/pack/* alt_objects/pack &&
        git repack -a &&
        myidx=$(ls -1 .git/objects/pack/*.idx) &&
@@ -95,14 +95,14 @@ test_expect_success 'packed obs in alternate ODB kept pack are repacked' '
        # swap the .keep so the commit object is in the pack with .keep
        for p in alt_objects/pack/*.pack
        do
-               base_name=$(basename $p .pack)
+               base_name=$(basename $p .pack) &&
                if test -f alt_objects/pack/$base_name.keep
                then
                        rm alt_objects/pack/$base_name.keep
                else
                        touch alt_objects/pack/$base_name.keep
                fi
-       done
+       done &&
        git repack -a -d &&
        myidx=$(ls -1 .git/objects/pack/*.idx) &&
        test -f "$myidx" &&
index 565365cbd3ff80d816dd02b2072045cd25ae4b93..158c8e33ef3381f3310ac39a99932d185290d685 100755 (executable)
@@ -33,7 +33,7 @@ test_expect_success 'more emptiness' '
 '
 
 test_expect_success 'git svn rebase creates empty directory' '
-       ( cd cloned && git svn rebase )
+       ( cd cloned && git svn rebase ) &&
        test -d cloned/"! !"
 '