Skip to content

Commit f45e867

Browse files
Jonathan del Strothergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent bfc07db commit f45e867

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

git-rebase.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ continue_merge () {
5959
die "$RESOLVEMSG"
6060
fi
6161

62-
cmt=`cat $dotest/current`
62+
cmt=`cat "$dotest/current"`
6363
if ! git diff-index --quiet HEAD
6464
then
6565
if ! git-commit -C "$cmt"
@@ -84,14 +84,14 @@ continue_merge () {
8484
}
8585

8686
call_merge () {
87-
cmt="$(cat $dotest/cmt.$1)"
87+
cmt="$(cat "$dotest/cmt.$1")"
8888
echo "$cmt" > "$dotest/current"
8989
hd=$(git rev-parse --verify HEAD)
9090
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")
9393
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")'
9595
export GITHEAD_$cmt GITHEAD_$hd
9696
git-merge-$strategy "$cmt^" -- "$hd" "$cmt"
9797
rv=$?
@@ -140,10 +140,10 @@ do
140140
}
141141
if test -d "$dotest"
142142
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")
147147
continue_merge
148148
while test "$msgnum" -le "$end"
149149
do
@@ -160,11 +160,11 @@ do
160160
if test -d "$dotest"
161161
then
162162
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")
166166
msgnum=$(($msgnum + 1))
167-
onto="`cat $dotest/onto`"
167+
onto=$(cat "$dotest/onto")
168168
while test "$msgnum" -le "$end"
169169
do
170170
call_merge "$msgnum"

0 commit comments

Comments
 (0)