@matheusbsbs / matheus-bagliano / commits / 1556ef1e37
Fork 0

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>

Junio C Hamano committed Dec 4, 2008 at 15:03 UTC 1556ef1e373e2928cd0d4a3630f142a57c1f1813
1 file changed +4 -4
git-am.sh
+4 -4
@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index."
121
122 prec=4
123 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=
125 resolvemsg= resume=
126 git_apply_opt=
127
@@ -156,7 +156,7 @@ do
156 --resolvemsg)
157 shift; resolvemsg=$1 ;;
158 --whitespace)
159 - git_apply_opt="$git_apply_opt $1=$2"; shift ;;
159 + ws="--whitespace=$2"; shift ;;
160 -C|-p)
161 git_apply_opt="$git_apply_opt $1$2"; shift ;;
162 --)
@@ -283,7 +283,7 @@ if test "$(cat "$dotest/keep")" = t
283 then
284 keep=-k
285 fi
286 -ws=`cat "$dotest/whitespace"`
286 +ws=$(cat "$dotest/whitespace")
287 if test "$(cat "$dotest/sign")" = t
288 then
289 SIGNOFF=`git var GIT_COMMITTER_IDENT | sed -e '
@@ -454,7 +454,7 @@ do
454
455 case "$resolved" in
456 '')
457 - git apply $git_apply_opt --index "$dotest/patch"
457 + git apply $git_apply_opt $ws --index "$dotest/patch"
458 apply_status=$?
459 ;;
460 t)