git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] Allow the test suite to pass in a directory whose name contains spaces

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 3, 2018, 16:54 UTC
Message-ID
<8d8cb562dcfa3faf65c7427c398158ec29e6fdbc.1514998470.git.johannes.schindelin@gmx.de>
In-Reply-To
<cover.1514998470.git.johannes.schindelin@gmx.de>

It is totally legitimate to clone Git's source code anywhere, including into, say, directories whose name (or the name of its absolute path) contains spaces.

However, a couple of tests failed to anticipate this, for lack of quoting (or in one instance, for failure to expect more than one space in the absolute path of the TEST_DIRECTORY). This can be easily verified by calling these commands in your current clone:

	git clone . with\ spaces
	cd with\ spaces
	make -j15 test
Let's fix this.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t7500-commit.sh          | 4 ++--
 t/t9020-remote-svn.sh      | 4 ++--
 t/t9107-git-svn-migrate.sh | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index 5739d3ed232..1d33c5feb3e 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -130,8 +130,8 @@ EOF
 test_expect_success 'commit message from template with whitespace issue' '
 	echo "content galore" >>foo &&
 	git add foo &&
-	GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-whitespaced-content git commit \
-		--template "$TEMPLATE" &&
+	GIT_EDITOR=\""$TEST_DIRECTORY"\"/t7500/add-whitespaced-content \
+	git commit --template "$TEMPLATE" &&
 	commit_msg_is "commit message"
 '
 
diff --git a/t/t9020-remote-svn.sh b/t/t9020-remote-svn.sh
index 4d81ba1c2c4..6fca08e5e35 100755
--- a/t/t9020-remote-svn.sh
+++ b/t/t9020-remote-svn.sh
@@ -25,8 +25,8 @@ init_git () {
 	git init &&
 	#git remote add svnsim testsvn::sim:///$TEST_DIRECTORY/t9020/example.svnrdump
 	# let's reuse an existing dump file!?
-	git remote add svnsim testsvn::sim://$TEST_DIRECTORY/t9154/svn.dump
-	git remote add svnfile testsvn::file://$TEST_DIRECTORY/t9154/svn.dump
+	git remote add svnsim "testsvn::sim://$TEST_DIRECTORY/t9154/svn.dump"
+	git remote add svnfile "testsvn::file://$TEST_DIRECTORY/t9154/svn.dump"
 }
 
 if test -e "$GIT_BUILD_DIR/git-remote-testsvn"
diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh
index 9f3ef8f2ef6..ceaa5bad105 100755
--- a/t/t9107-git-svn-migrate.sh
+++ b/t/t9107-git-svn-migrate.sh
@@ -28,7 +28,7 @@ test_expect_success 'git-svn-HEAD is a real HEAD' '
 	git rev-parse --verify refs/heads/git-svn-HEAD^0
 '
 
-svnrepo_escaped=$(echo $svnrepo | sed 's/ /%20/')
+svnrepo_escaped=$(echo $svnrepo | sed 's/ /%20/g')
 
 test_expect_success 'initialize old-style (v0) git svn layout' '
 	mkdir -p "$GIT_DIR"/git-svn/info "$GIT_DIR"/svn/info &&
-- 
2.15.1.windows.2.391.g0b42e3c56de
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 2 of 5 in “Several fixes for the test suite related to spaces in filenames”
  1. 0/2 Several fixes for the test suite related to spaces in filenamesJohannes Schindelin, Jan 3, 2018
  2. 1/2 Allow the test suite to pass in a directory whose name contains spacesJohannes Schindelin, Jan 3, 2018
  3. 2/2 t0302 & t3900: add forgotten quotesJohannes Schindelin, Jan 3, 2018
  4. Jeff KingJan 3, 2018
  5. Junio C HamanoJan 4, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.