]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1092: clean up script quoting
authorDerrick Stolee <dstolee@microsoft.com>
Tue, 30 Mar 2021 13:10:46 +0000 (13:10 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Mar 2021 19:57:45 +0000 (12:57 -0700)
This test was introduced in 19a0acc83e4 (t1092: test interesting
sparse-checkout scenarios, 2021-01-23), but it contains issues with quoting
that were not noticed until starting this follow-up series. The old
mechanism would drop quoting such as in

   test_all_match git commit -m "touch README.md"

The above happened to work because README.md is a file in the
repository, so 'git commit -m touch REAMDE.md' would succeed by
accident.

Other cases included quoting for no good reason, so clean that up now.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1092-sparse-checkout-compatibility.sh

index 8cd3e5a8d2277fc3b8cf33a29d34ec9c35f33551..3725d3997e70797981f6e82f2753865686277fd8 100755 (executable)
@@ -96,20 +96,20 @@ init_repos () {
 run_on_sparse () {
        (
                cd sparse-checkout &&
-               $* >../sparse-checkout-out 2>../sparse-checkout-err
+               "$@" >../sparse-checkout-out 2>../sparse-checkout-err
        )
 }
 
 run_on_all () {
        (
                cd full-checkout &&
-               $* >../full-checkout-out 2>../full-checkout-err
+               "$@" >../full-checkout-out 2>../full-checkout-err
        ) &&
-       run_on_sparse $*
+       run_on_sparse "$@"
 }
 
 test_all_match () {
-       run_on_all $* &&
+       run_on_all "$@" &&
        test_cmp full-checkout-out sparse-checkout-out &&
        test_cmp full-checkout-err sparse-checkout-err
 }
@@ -119,7 +119,7 @@ test_expect_success 'status with options' '
        test_all_match git status --porcelain=v2 &&
        test_all_match git status --porcelain=v2 -z -u &&
        test_all_match git status --porcelain=v2 -uno &&
-       run_on_all "touch README.md" &&
+       run_on_all touch README.md &&
        test_all_match git status --porcelain=v2 &&
        test_all_match git status --porcelain=v2 -z -u &&
        test_all_match git status --porcelain=v2 -uno &&
@@ -135,7 +135,7 @@ test_expect_success 'add, commit, checkout' '
        write_script edit-contents <<-\EOF &&
        echo text >>$1
        EOF
-       run_on_all "../edit-contents README.md" &&
+       run_on_all ../edit-contents README.md &&
 
        test_all_match git add README.md &&
        test_all_match git status --porcelain=v2 &&
@@ -144,7 +144,7 @@ test_expect_success 'add, commit, checkout' '
        test_all_match git checkout HEAD~1 &&
        test_all_match git checkout - &&
 
-       run_on_all "../edit-contents README.md" &&
+       run_on_all ../edit-contents README.md &&
 
        test_all_match git add -A &&
        test_all_match git status --porcelain=v2 &&
@@ -153,7 +153,7 @@ test_expect_success 'add, commit, checkout' '
        test_all_match git checkout HEAD~1 &&
        test_all_match git checkout - &&
 
-       run_on_all "../edit-contents deep/newfile" &&
+       run_on_all ../edit-contents deep/newfile &&
 
        test_all_match git status --porcelain=v2 -uno &&
        test_all_match git status --porcelain=v2 &&
@@ -186,7 +186,7 @@ test_expect_success 'diff --staged' '
        write_script edit-contents <<-\EOF &&
        echo text >>README.md
        EOF
-       run_on_all "../edit-contents" &&
+       run_on_all ../edit-contents &&
 
        test_all_match git diff &&
        test_all_match git diff --staged &&
@@ -280,7 +280,7 @@ test_expect_success 'clean' '
        echo bogus >>.gitignore &&
        run_on_all cp ../.gitignore . &&
        test_all_match git add .gitignore &&
-       test_all_match git commit -m ignore-bogus-files &&
+       test_all_match git commit -m "ignore bogus files" &&
 
        run_on_sparse mkdir folder1 &&
        run_on_all touch folder1/bogus &&