mirror of
https://github.com/git/git.git
synced 2024-09-26 15:01:19 +02:00
t: local VAR="VAL" (quote command substitution)
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 $(command substitution). Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
341aad8d41
commit
7f9f230b7f
@ -13,13 +13,13 @@ TEST_PASSES_SANITIZE_LEAK=true
|
|||||||
|
|
||||||
# Print the short OID of a symlink with the given name.
|
# Print the short OID of a symlink with the given name.
|
||||||
symlink_oid () {
|
symlink_oid () {
|
||||||
local oid=$(printf "%s" "$1" | git hash-object --stdin) &&
|
local oid="$(printf "%s" "$1" | git hash-object --stdin)" &&
|
||||||
git rev-parse --short "$oid"
|
git rev-parse --short "$oid"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print the short OID of the given file.
|
# Print the short OID of the given file.
|
||||||
short_oid () {
|
short_oid () {
|
||||||
local oid=$(git hash-object "$1") &&
|
local oid="$(git hash-object "$1")" &&
|
||||||
git rev-parse --short "$oid"
|
git rev-parse --short "$oid"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1840,7 +1840,7 @@ test_subcommand () {
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local expr=$(printf '"%s",' "$@")
|
local expr="$(printf '"%s",' "$@")"
|
||||||
expr="${expr%,}"
|
expr="${expr%,}"
|
||||||
|
|
||||||
if test -n "$negate"
|
if test -n "$negate"
|
||||||
|
Loading…
Reference in New Issue
Block a user