git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Derrick Stolee" <derrickstolee@github.com>,
	rsbecker@nexbridge.com, "SZEDER Gábor" <szeder.dev@gmail.com>,
	"Johannes Sixt" <j6t@kdbg.org>, "Jeff King" <peff@peff.net>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 2/3] test-lib.sh: fix prepend_var() quoting issue
Date: Wed, 22 Jun 2022 00:21:39 +0200	[thread overview]
Message-ID: <patch-2.3-e06bf0cdfbe-20220621T221928Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.3-00000000000-20220621T221928Z-avarab@gmail.com>

Fix a quoting issue in the function introduced in
b9638d7286f (test-lib: make $GIT_BUILD_DIR an absolute path,
2022-02-27), running the test suite where the git checkout was on a
path with e.g. a space in it would fail.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/test-lib.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 55857af601b..8cabb4d10f9 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -57,14 +57,14 @@ fi
 #
 #	prepend_var VAR : VALUE
 prepend_var () {
-	eval "$1=$3\${$1:+${3:+$2}\$$1}"
+	eval "$1=\"$3\${$1:+${3:+$2}\$$1}\""
 }
 
 # If [AL]SAN is in effect we want to abort so that we notice
 # problems. The GIT_SAN_OPTIONS variable can be used to set common
 # defaults shared between [AL]SAN_OPTIONS.
 prepend_var GIT_SAN_OPTIONS : abort_on_error=1
-prepend_var GIT_SAN_OPTIONS : strip_path_prefix=\"$GIT_BUILD_DIR/\"
+prepend_var GIT_SAN_OPTIONS : strip_path_prefix="$GIT_BUILD_DIR/"
 
 # If we were built with ASAN, it may complain about leaks
 # of program-lifetime variables. Disable it by default to lower
-- 
2.36.1.1239.gfba91521d90


  parent reply	other threads:[~2022-06-21 22:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21 22:21 [PATCH 0/3] tests: fix tests broken if a " " is in the checkout dir's path Ævar Arnfjörð Bjarmason
2022-06-21 22:21 ` [PATCH 1/3] tests: add missing double quotes to included library paths Ævar Arnfjörð Bjarmason
2022-06-21 22:42   ` Junio C Hamano
2022-06-21 22:21 ` Ævar Arnfjörð Bjarmason [this message]
2022-06-21 22:21 ` [PATCH 3/3] config tests: fix harmless but broken "rm -r" cleanup Ævar Arnfjörð Bjarmason
2022-06-21 22:34   ` Junio C Hamano
2022-06-22  5:37     ` Junio C Hamano
2022-06-30 10:18 ` [PATCH v2 0/3] tests: fix tests broken if a " " is in the checkout dir's path Ævar Arnfjörð Bjarmason
2022-06-30 10:18   ` [PATCH v2 1/3] tests: add missing double quotes to included library paths Ævar Arnfjörð Bjarmason
2022-06-30 10:18   ` [PATCH v2 2/3] test-lib.sh: fix prepend_var() quoting issue Ævar Arnfjörð Bjarmason
2022-06-30 10:18   ` [PATCH v2 3/3] config tests: fix harmless but broken "rm -r" cleanup Ævar Arnfjörð Bjarmason
2022-06-30 20:52     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-2.3-e06bf0cdfbe-20220621T221928Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=peff@peff.net \
    --cc=rsbecker@nexbridge.com \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).