diff options
author | Bryan Donlan <bdonlan@fushizen.net> | 2008-05-04 01:37:59 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-05-05 14:37:02 -0700 |
commit | f69e836fab2b634281d92a0d304de4d768e479cc (patch) | |
tree | ebd3e28ff26f0077846085d5c86970cc5ee05759 /t/t9500-gitweb-standalone-no-errors.sh | |
parent | 0e46e704626af5189c9c9ff2c0f348d2205c10f3 (diff) | |
download | git-f69e836fab2b634281d92a0d304de4d768e479cc.tar.gz git-f69e836fab2b634281d92a0d304de4d768e479cc.tar.xz |
Fix tests breaking when checkout path contains shell metacharacters
This fixes the remainder of the issues where the test script itself is at
fault for failing when the git checkout path contains whitespace or other
shell metacharacters.
The majority of git svn tests used the idiom
test_expect_success "title" "test script using $svnrepo"
These were changed to have the test script in single-quotes:
test_expect_success "title" 'test script using "$svnrepo"'
which unfortunately makes the patch appear larger than it really is.
One consequence of this change is that in the verbose test output the
value of $svnrepo (and in some cases other variables, too) is no
longer expanded, i.e. previously we saw
* expecting success:
test script using /path/to/git/t/trash/svnrepo
but now it is:
* expecting success:
test script using "$svnrepo"
Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9500-gitweb-standalone-no-errors.sh')
-rwxr-xr-x | t/t9500-gitweb-standalone-no-errors.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh index 3dc261d80..ae7082be1 100755 --- a/t/t9500-gitweb-standalone-no-errors.sh +++ b/t/t9500-gitweb-standalone-no-errors.sh @@ -10,6 +10,7 @@ commandline, and checks that it would not write any errors or warnings to log.' gitweb_init () { + safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')" cat >gitweb_config.perl <<EOF #!/usr/bin/perl @@ -17,16 +18,16 @@ gitweb_init () { our \$version = "current"; our \$GIT = "git"; -our \$projectroot = "$(pwd)"; +our \$projectroot = "$safe_pwd"; our \$project_maxdepth = 8; our \$home_link_str = "projects"; our \$site_name = "[localhost]"; our \$site_header = ""; our \$site_footer = ""; our \$home_text = "indextext.html"; -our @stylesheets = ("file:///$(pwd)/../../gitweb/gitweb.css"); -our \$logo = "file:///$(pwd)/../../gitweb/git-logo.png"; -our \$favicon = "file:///$(pwd)/../../gitweb/git-favicon.png"; +our @stylesheets = ("file:///$safe_pwd/../../gitweb/gitweb.css"); +our \$logo = "file:///$safe_pwd/../../gitweb/git-logo.png"; +our \$favicon = "file:///$safe_pwd/../../gitweb/git-favicon.png"; our \$projects_list = ""; our \$export_ok = ""; our \$strict_export = ""; @@ -53,7 +54,7 @@ gitweb_run () { # written to web server logs, so we are not interested in that: # we are interested only in properly formatted errors/warnings rm -f gitweb.log && - perl -- $(pwd)/../../gitweb/gitweb.perl \ + perl -- "$(pwd)/../../gitweb/gitweb.perl" \ >/dev/null 2>gitweb.log && if grep -q -s "^[[]" gitweb.log >/dev/null; then false; else true; fi |