git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Bryan Donlan <bdonlan@fushizen.net>
To: git@vger.kernel.org
Cc: Johannes Sixt <j.sixt@viscovery.net>,
	Adam Roben <aroben@apple.com>,
	gitster@pobox.com, Bryan Donlan <bdonlan@fushizen.net>
Subject: [PATCH v2 01/10] git-rebase.sh: Fix --merge --abort failures when path contains whitespace
Date: Thu, 10 Apr 2008 02:50:07 -0400	[thread overview]
Message-ID: <1207810216-27871-2-git-send-email-bdonlan@fushizen.net> (raw)
In-Reply-To: <1207810216-27871-1-git-send-email-bdonlan@fushizen.net>

Also update t/t3407-rebase-abort.sh to exercise the bug

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
---
 git-rebase.sh           |    2 +-
 t/t3407-rebase-abort.sh |   55 +++++++++++++++++++++++++++-------------------
 2 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index 9b13b83..c43afe5 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -214,7 +214,7 @@ do
 		else
 			die "No rebase in progress?"
 		fi
-		git reset --hard $(cat $dotest/orig-head)
+		git reset --hard $(cat "$dotest/orig-head")
 		rm -r "$dotest"
 		exit
 		;;
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index 37944c3..396a354 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -4,7 +4,13 @@ test_description='git rebase --abort tests'
 
 . ./test-lib.sh
 
+### Test that we handle strange characters properly
+work_dir="$(pwd)/test \" ' \$ \\ dir"
+
 test_expect_success setup '
+	mkdir -p "$work_dir" &&
+	cd "$work_dir" &&
+	git init &&
 	echo a > a &&
 	git add a &&
 	git commit -m a &&
@@ -27,42 +33,45 @@ testrebase() {
 	type=$1
 	dotest=$2
 
-	test_expect_success "rebase$type --abort" '
+	test_expect_success "rebase$type --abort" "
+		cd \"\$work_dir\" &&
 		# Clean up the state from the previous one
-		git reset --hard pre-rebase
-		test_must_fail git rebase'"$type"' master &&
-		test -d '$dotest' &&
+		git reset --hard pre-rebase &&
+		test_must_fail git rebase$type master &&
+		test -d \"\$dotest\" &&
 		git rebase --abort &&
-		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
-		test ! -d '$dotest'
-	'
+		test \$(git rev-parse to-rebase) = \$(git rev-parse pre-rebase) &&
+		test ! -d \"\$dotest\"
+	"
 
-	test_expect_success "rebase$type --abort after --skip" '
+	test_expect_success "rebase$type --abort after --skip" "
+		cd \"\$work_dir\" &&
 		# Clean up the state from the previous one
-		git reset --hard pre-rebase
-		test_must_fail git rebase'"$type"' master &&
-		test -d '$dotest' &&
+		git reset --hard pre-rebase &&
+		test_must_fail git rebase$type master &&
+		test -d \"\$dotest\" &&
 		test_must_fail git rebase --skip &&
-		test $(git rev-parse HEAD) = $(git rev-parse master) &&
+		test \$(git rev-parse HEAD) = \$(git rev-parse master) &&
 		git-rebase --abort &&
-		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
-		test ! -d '$dotest'
-	'
+		test \$(git rev-parse to-rebase) = \$(git rev-parse pre-rebase) &&
+		test ! -d \"\$dotest\"
+	"
 
-	test_expect_success "rebase$type --abort after --continue" '
+	test_expect_success "rebase$type --abort after --continue" "
+		cd \"\$work_dir\" &&
 		# Clean up the state from the previous one
-		git reset --hard pre-rebase
-		test_must_fail git rebase'"$type"' master &&
-		test -d '$dotest' &&
+		git reset --hard pre-rebase &&
+		test_must_fail git rebase$type master &&
+		test -d \"\$dotest\" &&
 		echo c > a &&
 		echo d >> a &&
 		git add a &&
 		test_must_fail git rebase --continue &&
-		test $(git rev-parse HEAD) != $(git rev-parse master) &&
+		test \$(git rev-parse HEAD) != \$(git rev-parse master) &&
 		git rebase --abort &&
-		test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
-		test ! -d '$dotest'
-	'
+		test \$(git rev-parse to-rebase) = \$(git rev-parse pre-rebase) &&
+		test ! -d \"\$dotest\"
+	"
 }
 
 testrebase "" .dotest
-- 
1.5.5.33.gc0a39.dirty

  reply	other threads:[~2008-04-10  6:52 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-09  1:29 [PATCH 0/8] Fix git's test suite to pass when the path contains spaces Bryan Donlan
2008-04-09  1:29 ` [PATCH 1/8] git-rebase.sh: Fix --merge --abort failures when path contains whitespace Bryan Donlan
2008-04-09  1:29   ` [PATCH 2/8] config.c: Escape backslashes in section names properly Bryan Donlan
2008-04-09  1:29     ` [PATCH 3/8] git-send-email.perl: Handle shell metacharacters in $EDITOR properly Bryan Donlan
2008-04-09  1:30       ` [PATCH 4/8] test-lib.sh: Fix some missing path quoting Bryan Donlan
2008-04-09  1:30         ` [PATCH 5/8] test-lib.sh: Add a test_set_editor function to safely set $VISUAL Bryan Donlan
2008-04-09  1:30           ` [PATCH 6/8] lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters Bryan Donlan
2008-04-09  1:30             ` [PATCH 7/8] Use test_set_editor in t9001-send-email.sh Bryan Donlan
2008-04-09  1:30               ` [PATCH 8/8] Fix tests breaking when checkout path contains shell metacharacters Bryan Donlan
     [not found]                 ` <47FC69B8.40809@viscovery.net>
     [not found]                   ` <20080410063028.GA12562@shion.is.fushizen.net>
2008-04-10  6:49                     ` Johannes Sixt
2008-04-10  7:02                       ` Bryan Donlan
2008-04-10  7:24                       ` Junio C Hamano
2008-04-09  7:01               ` [PATCH 7/8] Use test_set_editor in t9001-send-email.sh Johannes Sixt
2008-04-09 14:16                 ` Bryan Donlan
2008-04-09  6:50             ` [PATCH 6/8] lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters Junio C Hamano
2008-04-09  6:36           ` [PATCH 5/8] test-lib.sh: Add a test_set_editor function to safely set $VISUAL Johannes Sixt
2008-04-09  6:31       ` [PATCH 3/8] git-send-email.perl: Handle shell metacharacters in $EDITOR properly Johannes Sixt
2008-04-09 14:28         ` Bryan Donlan
2008-04-10  3:39         ` Junio C Hamano
2008-04-09  6:31     ` [PATCH 2/8] config.c: Escape backslashes in section names properly Johannes Sixt
2008-04-09 14:13       ` Bryan Donlan
2008-04-09 14:25         ` Johannes Sixt
2008-04-09  6:50   ` [PATCH 1/8] git-rebase.sh: Fix --merge --abort failures when path contains whitespace Junio C Hamano
2008-04-09  6:55   ` Johannes Sixt
2008-04-09 14:37     ` Bryan Donlan
2008-04-09 14:51       ` Johannes Sixt
2008-04-09 15:02         ` Bryan Donlan
2008-04-10  6:10           ` Johannes Sixt
2008-04-10  6:50 ` [PATCH v2 00/10] Fix git's test suite to pass when the path contains spaces Bryan Donlan
2008-04-10  6:50   ` Bryan Donlan [this message]
2008-04-10  6:50     ` [PATCH v2 02/10] config.c: Escape backslashes in section names properly Bryan Donlan
2008-04-10  6:50       ` [PATCH v2 03/10] git-send-email.perl: Handle shell metacharacters in $EDITOR properly Bryan Donlan
2008-04-10  6:50         ` [PATCH v2 04/10] test-lib.sh: Add a test_set_editor function to safely set $VISUAL Bryan Donlan
2008-04-10  6:50           ` [PATCH v2 05/10] Use test_set_editor in t9001-send-email.sh Bryan Donlan
2008-04-10  6:50             ` [PATCH v2 06/10] test-lib.sh: Fix some missing path quoting Bryan Donlan
2008-04-10  6:50               ` [PATCH v2 07/10] lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters Bryan Donlan
2008-04-10  6:50                 ` [PATCH v2 08/10] Don't use the export NAME=value form in the test scripts Bryan Donlan
2008-04-10  6:50                   ` [PATCH v2 09/10] Fix tests breaking when checkout path contains shell metacharacters Bryan Donlan
2008-04-10  6:50                     ` [PATCH v2 10/10] Rename the test trash directory to contain " Bryan Donlan
2008-04-10  7:45     ` [PATCH v2 01/10] git-rebase.sh: Fix --merge --abort failures when path contains whitespace Junio C Hamano
2008-04-10  8:48       ` Bryan Donlan
2008-04-11 22:37       ` Junio C Hamano
2008-05-04  5:37   ` [PATCH v3 00/10] Fix git's test suite to pass when the path contains spaces Bryan Donlan
2008-05-04  5:37     ` [PATCH v3 01/10] git-rebase.sh: Fix --merge --abort failures when path contains whitespace Bryan Donlan
2008-05-04  5:37       ` [PATCH v3 02/10] config.c: Escape backslashes in section names properly Bryan Donlan
2008-05-04  5:37         ` [PATCH v3 03/10] git-send-email.perl: Handle shell metacharacters in $EDITOR properly Bryan Donlan
2008-05-04  5:37           ` [PATCH v3 04/10] test-lib.sh: Add a test_set_editor function to safely set $VISUAL Bryan Donlan
2008-05-04  5:37             ` [PATCH v3 05/10] Use test_set_editor in t9001-send-email.sh Bryan Donlan
2008-05-04  5:37               ` [PATCH v3 06/10] test-lib.sh: Fix some missing path quoting Bryan Donlan
2008-05-04  5:37                 ` [PATCH v3 07/10] lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters Bryan Donlan
2008-05-04  5:37                   ` [PATCH v3 08/10] Don't use the export NAME=value form in the test scripts Bryan Donlan
2008-05-04  5:37                     ` [PATCH v3 09/10] Fix tests breaking when checkout path contains shell metacharacters Bryan Donlan
2008-05-04  5:38                       ` [PATCH v3 10/10] Rename the test trash directory to contain spaces Bryan Donlan
2008-05-05  8:25                         ` Johannes Sixt
2008-05-05  7:04                       ` [PATCH v3 09/10] Fix tests breaking when checkout path contains shell metacharacters Johannes Sixt
2008-05-05  7:57                         ` Bryan Donlan
2008-05-05  8:11                           ` Johannes Sixt
2008-05-05  7:03     ` [PATCH v3 00/10] Fix git's test suite to pass when the path contains spaces Johannes Sixt
2008-05-05  7:59       ` Bryan Donlan
2008-05-05  8:19         ` Johannes Sixt

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=1207810216-27871-2-git-send-email-bdonlan@fushizen.net \
    --to=bdonlan@fushizen.net \
    --cc=aroben@apple.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    /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).