@matheusbsbs / matheus-bagliano / commits / 889a50e909
Fork 0

Fixing path quoting in git-rebase

git-rebase used to fail when run from a path containing a space. Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Jonathan del Strother committed Oct 17, 2007 at 10:31 UTC 889a50e909dba5f4416049afc5eeae601fe133bc
1 file changed +13 -13
git-rebase.sh
+13 -13
@@ -59,7 +59,7 @@ continue_merge () {
59 die "$RESOLVEMSG"
60 fi
61
62 - cmt=`cat $dotest/current`
62 + cmt=`cat "$dotest/current"`
63 if ! git diff-index --quiet HEAD
64 then
65 if ! git-commit -C "$cmt"
@@ -84,14 +84,14 @@ continue_merge () {
84 }
85
86 call_merge () {
87 - cmt="$(cat $dotest/cmt.$1)"
87 + cmt="$(cat "$dotest/cmt.$1")"
88 echo "$cmt" > "$dotest/current"
89 hd=$(git rev-parse --verify HEAD)
90 cmt_name=$(git symbolic-ref HEAD)
91 - msgnum=$(cat $dotest/msgnum)
92 - end=$(cat $dotest/end)
91 + msgnum=$(cat "$dotest/msgnum")
92 + end=$(cat "$dotest/end")
93 eval GITHEAD_$cmt='"${cmt_name##refs/heads/}~$(($end - $msgnum))"'
94 - eval GITHEAD_$hd='"$(cat $dotest/onto_name)"'
94 + eval GITHEAD_$hd='$(cat "$dotest/onto_name")'
95 export GITHEAD_$cmt GITHEAD_$hd
96 git-merge-$strategy "$cmt^" -- "$hd" "$cmt"
97 rv=$?
@@ -140,10 +140,10 @@ do
140 }
141 if test -d "$dotest"
142 then
143 - prev_head="`cat $dotest/prev_head`"
144 - end="`cat $dotest/end`"
145 - msgnum="`cat $dotest/msgnum`"
146 - onto="`cat $dotest/onto`"
143 + prev_head=$(cat "$dotest/prev_head")
144 + end=$(cat "$dotest/end")
145 + msgnum=$(cat "$dotest/msgnum")
146 + onto=$(cat "$dotest/onto")
147 continue_merge
148 while test "$msgnum" -le "$end"
149 do
@@ -160,11 +160,11 @@ do
160 if test -d "$dotest"
161 then
162 git rerere clear
163 - prev_head="`cat $dotest/prev_head`"
164 - end="`cat $dotest/end`"
165 - msgnum="`cat $dotest/msgnum`"
163 + prev_head=$(cat "$dotest/prev_head")
164 + end=$(cat "$dotest/end")
165 + msgnum=$(cat "$dotest/msgnum")
166 msgnum=$(($msgnum + 1))
167 - onto="`cat $dotest/onto`"
167 + onto=$(cat "$dotest/onto")
168 while test "$msgnum" -le "$end"
169 do
170 call_merge "$msgnum"