Skip to content

Commit 1556ef1

Browse files
committed
git-am --whitespace: do not lose the command line option
When you start "git am --whitespace=fix" and the patch application process is interrupted by an unapplicable patch early in the series, after fixing the offending patch, the remainder of the patch should be processed still with --whitespace=fix when restarted with "git am --resolved" (or dropping the offending patch with "git am --skip"). The breakage was introduced by the commit 67dad68 (add -C[NUM] to git-am, 2007-02-08); this should fix it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 123ed65 commit 1556ef1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

git-am.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index."
121121

122122
prec=4
123123
dotest="$GIT_DIR/rebase-apply"
124-
sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
124+
sign= utf8=t keep= skip= interactive= resolved= rebasing= abort= ws=
125125
resolvemsg= resume=
126126
git_apply_opt=
127127

@@ -156,7 +156,7 @@ do
156156
--resolvemsg)
157157
shift; resolvemsg=$1 ;;
158158
--whitespace)
159-
git_apply_opt="$git_apply_opt $1=$2"; shift ;;
159+
ws="--whitespace=$2"; shift ;;
160160
-C|-p)
161161
git_apply_opt="$git_apply_opt $1$2"; shift ;;
162162
--)
@@ -283,7 +283,7 @@ if test "$(cat "$dotest/keep")" = t
283283
then
284284
keep=-k
285285
fi
286-
ws=`cat "$dotest/whitespace"`
286+
ws=$(cat "$dotest/whitespace")
287287
if test "$(cat "$dotest/sign")" = t
288288
then
289289
SIGNOFF=`git var GIT_COMMITTER_IDENT | sed -e '
@@ -454,7 +454,7 @@ do
454454

455455
case "$resolved" in
456456
'')
457-
git apply $git_apply_opt --index "$dotest/patch"
457+
git apply $git_apply_opt $ws --index "$dotest/patch"
458458
apply_status=$?
459459
;;
460460
t)

0 commit comments

Comments
 (0)