]> git.ipfire.org Git - thirdparty/git.git/commitdiff
annotate-tests: quote variable expansions containing path names
authorJohannes Sixt <j6t@kdbg.org>
Sat, 30 Jan 2021 16:22:25 +0000 (17:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 30 Jan 2021 23:15:06 +0000 (15:15 -0800)
The test case added by 9466e3809d ("blame: enable funcname blaming with
userdiff driver", 2020-11-01) forgot to quote variable expansions. This
causes failures when the current directory contains blanks.

One variable that the test case introduces will not have IFS characters
and could remain without quotes, but let's quote all expansions for
consistency, not just the one that has the path name.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/annotate-tests.sh

index 3aee61d2cc1fa6bc97976fff30d3516f55abab80..a2e46572d5bf08b1bfc49817fd104a2750d66ed9 100644 (file)
@@ -483,12 +483,12 @@ test_expect_success 'setup -L :funcname with userdiff driver' '
        echo "fortran-* diff=fortran" >.gitattributes &&
        fortran_file=fortran-external-function &&
        orig_file="$TEST_DIRECTORY/t4018/$fortran_file" &&
-       cp $orig_file . &&
-       git add $fortran_file &&
+       cp "$orig_file" . &&
+       git add "$fortran_file" &&
        GIT_AUTHOR_NAME="A" GIT_AUTHOR_EMAIL="A@test.git" \
        git commit -m "add fortran file" &&
-       sed -e "s/ChangeMe/IWasChanged/" <"$orig_file" >$fortran_file &&
-       git add $fortran_file &&
+       sed -e "s/ChangeMe/IWasChanged/" <"$orig_file" >"$fortran_file" &&
+       git add "$fortran_file" &&
        GIT_AUTHOR_NAME="B" GIT_AUTHOR_EMAIL="B@test.git" \
        git commit -m "change fortran file"
 '