]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-am.sh
Merge branch 'jc/upload-pack-hook'
[git.git] / git-am.sh
index dd60f5d9cb6e8713551a5d3e93c40f9a0097a839..3c03f3e0df96f7b993db1c3822d3f3dab8741a4b 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -16,6 +16,8 @@ s,signoff       add a Signed-off-by line to the commit message
 u,utf8          recode into utf8 (default)
 k,keep          pass -k flag to git-mailinfo
 whitespace=     pass it through git-apply
+ignore-space-change pass it through git-apply
+ignore-whitespace pass it through git-apply
 directory=      pass it through git-apply
 C=              pass it through git-apply
 p=              pass it through git-apply
@@ -211,7 +213,13 @@ check_patch_format () {
 split_patches () {
        case "$patch_format" in
        mbox)
-               git mailsplit -d"$prec" -o"$dotest" -b -- "$@" > "$dotest/last" ||
+               case "$rebasing" in
+               '')
+                       keep_cr= ;;
+               ?*)
+                       keep_cr=--keep-cr ;;
+               esac
+               git mailsplit -d"$prec" -o"$dotest" -b $keep_cr -- "$@" > "$dotest/last" ||
                clean_abort
                ;;
        stgit-series)
@@ -268,7 +276,11 @@ split_patches () {
                msgnum=
                ;;
        *)
-               clean_abort "Patch format $patch_format is not supported."
+               if test -n "$parse_patch" ; then
+                       clean_abort "Patch format $patch_format is not supported."
+               else
+                       clean_abort "Patch format detection failed."
+               fi
                ;;
        esac
 }
@@ -317,7 +329,7 @@ do
                git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;;
        --patch-format)
                shift ; patch_format="$1" ;;
-       --reject)
+       --reject|--ignore-whitespace|--ignore-space-change)
                git_apply_opt="$git_apply_opt $1" ;;
        --committer-date-is-author-date)
                committer_date_is_author_date=t ;;