diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-04-05 17:08:59 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-04-05 22:50:10 -0700 |
| commit | 341aad8d41ca8321d826e1ce012e4faf1a8be2a4 (patch) | |
| tree | 03549339b89260e4d5c3650ac78da77d63f301b8 /t/test-lib-functions.sh | |
| parent | CodingGuidelines: quote assigned value in 'local var=$val' (diff) | |
| download | git-341aad8d41ca8321d826e1ce012e4faf1a8be2a4.tar.gz git-341aad8d41ca8321d826e1ce012e4faf1a8be2a4.zip | |
t: local VAR="VAL" (quote positional parameters)
Future-proof test scripts that do
local VAR=VAL
without quoting VAL (which is OK in POSIX but broken in some shells)
that is a positional parameter, e.g. $4.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib-functions.sh')
| -rw-r--r-- | t/test-lib-functions.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 2eccf100c0..fc60708471 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -1765,7 +1765,7 @@ test_parse_ls_tree_oids () { # Choose a port number based on the test script's number and store it in # the given variable name, unless that variable already contains a number. test_set_port () { - local var=$1 port + local var="$1" port if test $# -ne 1 || test -z "$var" then |
