]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test-lib-functions: test_cmp: eval $GIT_TEST_CMP
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Wed, 25 Mar 2020 15:06:15 +0000 (22:06 +0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Mar 2020 15:54:37 +0000 (08:54 -0700)
Shell recognises first non-assignment token as command name.
With /bin/sh linked to either /bin/bash or /bin/dash,
`cd t/perf && ./p0000-perf-lib-sanity.sh -d -i -v` reports:

> test_cmp:1: command not found: diff -u

Using `eval` to unquote $GIT_TEST_CMP as same as precedence in `git_editor`.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib-functions.sh

index 352c213d52e2e4a50808128c027eba7f1ac163df..ab0e47ae1748d9c91ffb5b992c180ef095e86b49 100644 (file)
@@ -905,7 +905,7 @@ test_expect_code () {
 # - not all diff versions understand "-u"
 
 test_cmp() {
-       $GIT_TEST_CMP "$@"
+       eval "$GIT_TEST_CMP" '"$@"'
 }
 
 # Check that the given config key has the expected value.