[PATCH 1/3] Fixing path quoting in git-rebase

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jonathan del Strother
Date: Monday, October 15, 2007 - 6:13 am

From: Jonathan del Strother <jon.delStrother@bestbefore.tv>

git-rebase used to fail when run from a path with a space in.

Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
---
 git-rebase.sh |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index 1583402..9995d9d 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -59,7 +59,7 @@ continue_merge () {
 		die "$RESOLVEMSG"
 	fi
 
-	cmt=`cat $dotest/current`
+	cmt=`cat "$dotest/current"`
 	if ! git diff-index --quiet HEAD
 	then
 		if ! git-commit -C "$cmt"
@@ -84,14 +84,14 @@ continue_merge () {
 }
 
 call_merge () {
-	cmt="$(cat $dotest/cmt.$1)"
+	cmt="$(cat "$dotest/cmt.$1")"
 	echo "$cmt" > "$dotest/current"
 	hd=$(git rev-parse --verify HEAD)
 	cmt_name=$(git symbolic-ref HEAD)
-	msgnum=$(cat $dotest/msgnum)
-	end=$(cat $dotest/end)
+	msgnum=$(cat "$dotest/msgnum")
+	end=$(cat "$dotest/end")
 	eval GITHEAD_$cmt='"${cmt_name##refs/heads/}~$(($end - $msgnum))"'
-	eval GITHEAD_$hd='"$(cat $dotest/onto_name)"'
+	eval GITHEAD_$hd='"$(cat \"$dotest/onto_name\")"'
 	export GITHEAD_$cmt GITHEAD_$hd
 	git-merge-$strategy "$cmt^" -- "$hd" "$cmt"
 	rv=$?
@@ -140,10 +140,10 @@ do
 		}
 		if test -d "$dotest"
 		then
-			prev_head="`cat $dotest/prev_head`"
-			end="`cat $dotest/end`"
-			msgnum="`cat $dotest/msgnum`"
-			onto="`cat $dotest/onto`"
+			prev_head=$(cat "$dotest/prev_head")
+			end=$(cat "$dotest/end")
+			msgnum=$(cat "$dotest/msgnum")
+			onto=$(cat "$dotest/onto")
 			continue_merge
 			while test "$msgnum" -le "$end"
 			do
@@ -160,11 +160,11 @@ do
 		if test -d "$dotest"
 		then
 			git rerere clear
-			prev_head="`cat $dotest/prev_head`"
-			end="`cat $dotest/end`"
-			msgnum="`cat $dotest/msgnum`"
+			prev_head=$(cat "$dotest/prev_head")
+			end=$(cat "$dotest/end")
+			msgnum=$(cat "$dotest/msgnum")
 			msgnum=$(($msgnum + 1))
-			onto="`cat $dotest/onto`"
+			onto=$(cat "$dotest/onto")
 			while test "$msgnum" -le "$end"
 			do
 				call_merge "$msgnum"
-- 
1.5.3.1

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Fixing path quoting issues, Jonathan del Strother, (Wed Oct 10, 2:13 pm)
Re: [PATCH] Fixing path quoting issues, Johannes Sixt, (Wed Oct 10, 11:19 pm)
Re: [PATCH] Fixing path quoting issues, David Kastrup, (Wed Oct 10, 11:47 pm)
Re: [PATCH] Fixing path quoting issues, Johannes Sixt, (Thu Oct 11, 12:10 am)
Re: [PATCH] Fixing path quoting issues, Jonathan del Strother, (Thu Oct 11, 12:30 am)
Re: [PATCH] Fixing path quoting issues, Johannes Sixt, (Thu Oct 11, 12:41 am)
Re: [PATCH] Fixing path quoting issues, David Kastrup, (Thu Oct 11, 1:53 pm)
Re: [PATCH] Fixing path quoting issues, Jonathan del Strother, (Thu Oct 11, 2:22 pm)
Re: [PATCH] Fixing path quoting issues, Johannes Schindelin, (Thu Oct 11, 2:31 pm)
Re: [PATCH] Fixing path quoting issues, David Kastrup, (Thu Oct 11, 2:40 pm)
Re: [PATCH] Fixing path quoting issues, Johannes Sixt, (Thu Oct 11, 11:43 pm)
Re: [PATCH] Fixing path quoting issues, Wincent Colaiuta, (Fri Oct 12, 4:17 am)
Re: [PATCH] Fixing path quoting issues, Johannes Schindelin, (Fri Oct 12, 4:37 am)
Re: [PATCH] Fixing path quoting issues, Wincent Colaiuta, (Fri Oct 12, 5:20 am)
Re: [PATCH] Fixing path quoting issues, Johannes Schindelin, (Fri Oct 12, 5:51 am)
Re: [PATCH] Fixing path quoting issues, Jonathan del Strother, (Sat Oct 13, 11:12 am)
Re: [PATCH] Fixing path quoting issues, Andreas Ericsson, (Sat Oct 13, 3:36 pm)
Re: [PATCH] Fixing path quoting issues, Jonathan del Strother, (Mon Oct 15, 6:13 am)
[PATCH 1/3] Fixing path quoting in git-rebase, Jonathan del Strother, (Mon Oct 15, 6:13 am)
[PATCH 2/3] Quoting paths in tests, Jonathan del Strother, (Mon Oct 15, 6:13 am)
[PATCH 3/3] Fix apostrophe quoting in tests, Jonathan del Strother, (Mon Oct 15, 6:13 am)
Re: [PATCH 1/3] Fixing path quoting in git-rebase, Johannes Sixt, (Mon Oct 15, 6:39 am)
Re: [PATCH 2/3] Quoting paths in tests, Johannes Sixt, (Mon Oct 15, 6:47 am)
Re: [PATCH 2/3] Quoting paths in tests, Jonathan del Strother, (Mon Oct 15, 7:00 am)
Re: [PATCH 2/3] Quoting paths in tests, Johannes Sixt, (Mon Oct 15, 7:17 am)
Re: [PATCH 1/3] Fixing path quoting in git-rebase, Jonathan del Strother, (Wed Oct 17, 2:14 am)
[PATCH] Quoting paths, take 3, Jonathan del Strother, (Wed Oct 17, 2:31 am)
[PATCH 1/2] Fixing path quoting in git-rebase, Jonathan del Strother, (Wed Oct 17, 2:31 am)
[PATCH 2/2] Quoting paths in tests, Jonathan del Strother, (Wed Oct 17, 2:31 am)
Re: [PATCH 1/2] Fixing path quoting in git-rebase, Johannes Sixt, (Wed Oct 17, 3:41 am)
Re: [PATCH 2/2] Quoting paths in tests, Johannes Sixt, (Wed Oct 17, 4:32 am)
Re: [PATCH 2/2] Quoting paths in tests, Jonathan del Strother, (Wed Oct 17, 10:07 am)
Re: [PATCH 2/2] Quoting paths in tests, Johannes Sixt, (Wed Oct 17, 11:08 pm)
Re: [PATCH 2/2] Quoting paths in tests, Jonathan del Strother, (Wed Oct 24, 6:07 am)