mirror of
https://github.com/git/git.git
synced 2024-05-28 09:16:10 +02:00
t: local VAR="VAL" (quote ${magic-reference})
Future-proof test scripts that do local VAR=VAL without quoting VAL (which is OK in POSIX but broken in some shells) that is ${magic-"reference to a parameter"}. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
7f9f230b7f
commit
e97f4a6d94
|
@ -385,7 +385,7 @@ test_commit () {
|
||||||
shift
|
shift
|
||||||
done &&
|
done &&
|
||||||
indir=${indir:+"$indir"/} &&
|
indir=${indir:+"$indir"/} &&
|
||||||
local file=${2:-"$1.t"} &&
|
local file="${2:-"$1.t"}" &&
|
||||||
if test -n "$append"
|
if test -n "$append"
|
||||||
then
|
then
|
||||||
$echo "${3-$1}" >>"$indir$file"
|
$echo "${3-$1}" >>"$indir$file"
|
||||||
|
@ -1748,7 +1748,7 @@ test_oid () {
|
||||||
# Insert a slash into an object ID so it can be used to reference a location
|
# Insert a slash into an object ID so it can be used to reference a location
|
||||||
# under ".git/objects". For example, "deadbeef..." becomes "de/adbeef..".
|
# under ".git/objects". For example, "deadbeef..." becomes "de/adbeef..".
|
||||||
test_oid_to_path () {
|
test_oid_to_path () {
|
||||||
local basename=${1#??}
|
local basename="${1#??}"
|
||||||
echo "${1%$basename}/$basename"
|
echo "${1%$basename}/$basename"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1930,7 +1930,7 @@ test_readlink () {
|
||||||
# An optional increment to the magic timestamp may be specified as second
|
# An optional increment to the magic timestamp may be specified as second
|
||||||
# argument.
|
# argument.
|
||||||
test_set_magic_mtime () {
|
test_set_magic_mtime () {
|
||||||
local inc=${2:-0} &&
|
local inc="${2:-0}" &&
|
||||||
local mtime=$((1234567890 + $inc)) &&
|
local mtime=$((1234567890 + $inc)) &&
|
||||||
test-tool chmtime =$mtime "$1" &&
|
test-tool chmtime =$mtime "$1" &&
|
||||||
test_is_magic_mtime "$1" $inc
|
test_is_magic_mtime "$1" $inc
|
||||||
|
@ -1943,7 +1943,7 @@ test_set_magic_mtime () {
|
||||||
# argument. Usually, this should be the same increment which was used for
|
# argument. Usually, this should be the same increment which was used for
|
||||||
# the associated test_set_magic_mtime.
|
# the associated test_set_magic_mtime.
|
||||||
test_is_magic_mtime () {
|
test_is_magic_mtime () {
|
||||||
local inc=${2:-0} &&
|
local inc="${2:-0}" &&
|
||||||
local mtime=$((1234567890 + $inc)) &&
|
local mtime=$((1234567890 + $inc)) &&
|
||||||
echo $mtime >.git/test-mtime-expect &&
|
echo $mtime >.git/test-mtime-expect &&
|
||||||
test-tool chmtime --get "$1" >.git/test-mtime-actual &&
|
test-tool chmtime --get "$1" >.git/test-mtime-actual &&
|
||||||
|
|
Loading…
Reference in New Issue