]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3600-rm.sh
mailinfo: factor out some repeated header handling
[thirdparty/git.git] / t / t3600-rm.sh
index 8c8cca5bfb1eaff0474e4bc8bca423ba503a633c..0ea858d652fcb5aee58e8a71c6d68cdbcfb974ea 100755 (executable)
@@ -113,9 +113,10 @@ test_expect_success '"rm" command printed' '
        echo frotz >test-file &&
        git add test-file &&
        git commit -m "add file for rm test" &&
-       git rm test-file >rm-output &&
-       test $(grep "^rm " rm-output | wc -l) = 1 &&
-       rm -f test-file rm-output &&
+       git rm test-file >rm-output.raw &&
+       grep "^rm " rm-output.raw >rm-output &&
+       test_line_count = 1 rm-output &&
+       rm -f test-file rm-output.raw rm-output &&
        git commit -m "remove file from rm test"
 '
 
@@ -250,6 +251,7 @@ test_expect_success 'choking "git rm" should not let it die with cruft' '
                echo "100644 $hash 0    some-file-$i"
                i=$(( $i + 1 ))
        done | git update-index --index-info &&
+       # git command is intentionally placed upstream of pipe to induce SIGPIPE
        git rm -n "some-file-*" | : &&
        test_path_is_missing .git/index.lock
 '
@@ -303,7 +305,8 @@ EOF
 
 test_expect_success 'rm removes empty submodules from work tree' '
        mkdir submod &&
-       git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) submod &&
+       hash=$(git rev-parse HEAD) &&
+       git update-index --add --cacheinfo 160000 "$hash" submod &&
        git config -f .gitmodules submodule.sub.url ./. &&
        git config -f .gitmodules submodule.sub.path submod &&
        git submodule init &&
@@ -622,7 +625,8 @@ test_expect_success 'setup subsubmodule' '
        git submodule update &&
        (
                cd submod &&
-               git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) subsubmod &&
+               hash=$(git rev-parse HEAD) &&
+               git update-index --add --cacheinfo 160000 "$hash" subsubmod &&
                git config -f .gitmodules submodule.sub.url ../. &&
                git config -f .gitmodules submodule.sub.path subsubmod &&
                git submodule init &&