From f69e836fab2b634281d92a0d304de4d768e479cc Mon Sep 17 00:00:00 2001 From: Bryan Donlan Date: Sun, 4 May 2008 01:37:59 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- t/t9115-git-svn-dcommit-funky-renames.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 't/t9115-git-svn-dcommit-funky-renames.sh') diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh index 182299cbb5..298445f7d9 100755 --- a/t/t9115-git-svn-dcommit-funky-renames.sh +++ b/t/t9115-git-svn-dcommit-funky-renames.sh @@ -7,16 +7,16 @@ test_description='git-svn dcommit can commit renames of files with ugly names' . ./lib-git-svn.sh -test_expect_success 'load repository with strange names' " - svnadmin load -q $rawsvnrepo < ../t9115/funky-names.dump && +test_expect_success 'load repository with strange names' ' + svnadmin load -q "$rawsvnrepo" < ../t9115/funky-names.dump && start_httpd - " + ' -test_expect_success 'init and fetch repository' " - git svn init $svnrepo && +test_expect_success 'init and fetch repository' ' + git svn init "$svnrepo" && git svn fetch && git reset --hard git-svn - " + ' test_expect_success 'create file in existing ugly and empty dir' ' mkdir "#{bad_directory_name}" && -- cgit v1.2.3 From d1a8d0ea5fb2d4d43d0ea8f2fe45ec1fce7ec4bc Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 10 May 2008 17:14:49 -0700 Subject: git-svn: fix cloning of HTTP URLs with '+' in their path With this, git svn clone -s http://svn.gnome.org/svn/gtk+ is successful. Also modified the funky rename test for this, which _does_ include escaped '+' signs for HTTP URLs. SVN seems to accept either "+" or "%2B" in filenames and directories (just not the main URL), so I'll leave it alone for now. Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- t/t9115-git-svn-dcommit-funky-renames.sh | 35 +++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 't/t9115-git-svn-dcommit-funky-renames.sh') diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh index 182299cbb5..4acbcb0acd 100755 --- a/t/t9115-git-svn-dcommit-funky-renames.sh +++ b/t/t9115-git-svn-dcommit-funky-renames.sh @@ -9,7 +9,7 @@ test_description='git-svn dcommit can commit renames of files with ugly names' test_expect_success 'load repository with strange names' " svnadmin load -q $rawsvnrepo < ../t9115/funky-names.dump && - start_httpd + start_httpd gtk+ " test_expect_success 'init and fetch repository' " @@ -49,6 +49,39 @@ test_expect_success 'rename pretty file into ugly one' ' git svn dcommit ' +test_expect_success 'add a file with plus signs' ' + echo .. > +_+ && + git update-index --add +_+ && + git commit -m plus && + mkdir gtk+ && + git mv +_+ gtk+/_+_ && + git commit -m plus_dir && + git svn dcommit + ' + +test_expect_success 'clone the repository to test rebase' " + git svn clone $svnrepo test-rebase && + cd test-rebase && + echo test-rebase > test-rebase && + git add test-rebase && + git commit -m test-rebase && + cd .. + " + +test_expect_success 'make a commit to test rebase' " + echo test-rebase-main > test-rebase-main && + git add test-rebase-main && + git commit -m test-rebase-main && + git svn dcommit + " + +test_expect_success 'git-svn rebase works inside a fresh-cloned repository' " + cd test-rebase && + git svn rebase && + test -e test-rebase-main && + test -e test-rebase + " + stop_httpd test_done -- cgit v1.2.3 From bfdbee98109c5ad2dbbc392e7eed1ae688acc039 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 8 Aug 2008 02:26:28 -0700 Subject: tests: use $TEST_DIRECTORY to refer to the t/ directory Many test scripts assumed that they will start in a 'trash' subdirectory that is a single level down from the t/ directory, and referred to their test vector files by asking for files like "../t9999/expect". This will break if we move the 'trash' subdirectory elsewhere. To solve this, we earlier introduced "$TEST_DIRECTORY" so that they can refer to t/ directory reliably. This finally makes all the tests use it to refer to the outside environment. With this patch, and a one-liner not included here (because it would contradict with what Dscho really wants to do): | diff --git a/t/test-lib.sh b/t/test-lib.sh | index 70ea7e0..60e69e4 100644 | --- a/t/test-lib.sh | +++ b/t/test-lib.sh | @@ -485,7 +485,7 @@ fi | . ../GIT-BUILD-OPTIONS | | # Test repository | -test="trash directory" | +test="trash directory/another level/yet another" | rm -fr "$test" || { | trap - exit | echo >&5 "FATAL: Cannot prepare test area" all the tests still pass, but we would want extra sets of eyeballs on this type of change to really make sure. [jc: with help from Stephan Beyer on http-push tests I do not run myself; credits for locating silly quoting errors go to Olivier Marin.] Signed-off-by: Junio C Hamano --- t/t9115-git-svn-dcommit-funky-renames.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t9115-git-svn-dcommit-funky-renames.sh') diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh index f0fbd3aff7..b0ba1f0200 100755 --- a/t/t9115-git-svn-dcommit-funky-renames.sh +++ b/t/t9115-git-svn-dcommit-funky-renames.sh @@ -8,7 +8,7 @@ test_description='git-svn dcommit can commit renames of files with ugly names' . ./lib-git-svn.sh test_expect_success 'load repository with strange names' ' - svnadmin load -q "$rawsvnrepo" < ../t9115/funky-names.dump && + svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9115/funky-names.dump && start_httpd gtk+ ' -- cgit v1.2.3 From 1364ff27dc5ecca4c1932d8fa09fe88a7c09fda0 Mon Sep 17 00:00:00 2001 From: Nanako Shiraishi Date: Mon, 8 Sep 2008 19:02:08 +0900 Subject: t/t91XX git-svn tests: run "git svn" not "git-svn" This replaces 'git-svn' with 'git svn' in the tests. Signed-off-by: Nanako Shiraishi Signed-off-by: Junio C Hamano --- t/t9115-git-svn-dcommit-funky-renames.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/t9115-git-svn-dcommit-funky-renames.sh') diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh index b0ba1f0200..9be7aefaee 100755 --- a/t/t9115-git-svn-dcommit-funky-renames.sh +++ b/t/t9115-git-svn-dcommit-funky-renames.sh @@ -3,7 +3,7 @@ # Copyright (c) 2007 Eric Wong -test_description='git-svn dcommit can commit renames of files with ugly names' +test_description='git svn dcommit can commit renames of files with ugly names' . ./lib-git-svn.sh @@ -75,7 +75,7 @@ test_expect_success 'make a commit to test rebase' ' git svn dcommit ' -test_expect_success 'git-svn rebase works inside a fresh-cloned repository' ' +test_expect_success 'git svn rebase works inside a fresh-cloned repository' ' cd test-rebase && git svn rebase && test -e test-rebase-main && -- cgit v1.2.3