]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-am.sh
Merge branch 'kc/maint-diff-bwi-fix' into maint
[git.git] / git-am.sh
index 1bf70d47779aeddd281895bc5523ed66a549da99..4b157fe5d536fdbdbf85e0e06c419b5927a90867 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index."
 
 prec=4
 dotest="$GIT_DIR/rebase-apply"
-sign= utf8=t keep= skip= interactive= resolved= rebasing= abort= ws=
+sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
 resolvemsg= resume=
 git_apply_opt=
 
@@ -156,7 +156,7 @@ do
        --resolvemsg)
                shift; resolvemsg=$1 ;;
        --whitespace)
-               ws="--whitespace=$2"; shift ;;
+               git_apply_opt="$git_apply_opt $1=$2"; shift ;;
        -C|-p)
                git_apply_opt="$git_apply_opt $1$2"; shift ;;
        --)
@@ -247,10 +247,11 @@ else
                exit 1
        }
 
-       # -s, -u, -k and --whitespace flags are kept for the
-       # resuming session after a patch failure.
-       # -3 and -i can and must be given when resuming.
-       echo " $ws" >"$dotest/whitespace"
+       # -s, -u, -k, --whitespace, -3, -C and -p flags are kept
+       # for the resuming session after a patch failure.
+       # -i can and must be given when resuming.
+       echo " $git_apply_opt" >"$dotest/apply-opt"
+       echo "$threeway" >"$dotest/threeway"
        echo "$sign" >"$dotest/sign"
        echo "$utf8" >"$dotest/utf8"
        echo "$keep" >"$dotest/keep"
@@ -283,7 +284,11 @@ if test "$(cat "$dotest/keep")" = t
 then
        keep=-k
 fi
-ws=$(cat "$dotest/whitespace")
+if test "$(cat "$dotest/threeway")" = t
+then
+       threeway=t
+fi
+git_apply_opt=$(cat "$dotest/apply-opt")
 if test "$(cat "$dotest/sign")" = t
 then
        SIGNOFF=`git var GIT_COMMITTER_IDENT | sed -e '
@@ -454,7 +459,7 @@ do
 
        case "$resolved" in
        '')
-               git apply $git_apply_opt $ws --index "$dotest/patch"
+               git apply $git_apply_opt --index "$dotest/patch"
                apply_status=$?
                ;;
        t)