Subject: Re: [PATCH] Have tests and programs understand paths containing spaces

From: Johannes Sixt <[email-masked]>
Date: Wed, 23 Apr 2008 09:13:04 +0200

Arjen Laarhoven schrieb:
> A lot of tests and some core programs didn't work when used in a path
> containing whitespace.  Correct the quoting of all affected programs to
> fix this.

Please separate fixes of core programs/scripts from fixes of the tests
(because the former have a much higher chance of being accepted).

But see these threads first:

http://thread.gmane.org/gmane.comp.version-control.git/60544
http://thread.gmane.org/gmane.comp.version-control.git/79057

Here a few comments:

> +GIT_DIR="$PWD/.git"
> +GIT_SVN_DIR="$GIT_DIR/svn/git-svn"
> +SVN_TREE="$GIT_SVN_DIR/svn-tree"
> +svnrepo="$PWD/svnrepo"

These are unnecessary: RHS of an assignment does not undergo word splitting.

> -test_expect_success "checkout from svn" "svn co $svnrepo '$SVN_TREE'"
> +test_expect_success "checkout from svn" "svn co '$svnrepo' '$SVN_TREE'"

> -	git diff help $SVN_TREE/exec-2.sh"
> +	git diff help '$SVN_TREE'/exec-2.sh"

These changes protect *only* against space-in-name, but not
random-special-character-in-name. The proper fix is to change the quoting from

  test_expect_success "..." "... $svnrepo ..."

to

  test_expect_success '...' '... "$svnrepo" ...'

-- Hannes