gitweb: Fix error in git_patchset_body for deletion in merge commit
[gitweb.git] / git-applymbox.sh
index 5569fdcc3463b214411d5a168a00783b0d390044..c18e80ff8cd5a66a64e22cf96e77fad519d33b5d 100755 (executable)
@@ -23,11 +23,12 @@ USAGE='[-u] [-k] [-q] [-m] (-c .dotest/<num> | mbox) [signoff]'
 
 git var GIT_COMMITTER_IDENT >/dev/null || exit
 
-keep_subject= query_apply= continue= utf8= resume=t
+keep_subject= query_apply= continue= utf8=-u resume=t
 while case "$#" in 0) break ;; esac
 do
        case "$1" in
        -u)     utf8=-u ;;
+       -n)     utf8=-n ;;
        -k)     keep_subject=-k ;;
        -q)     query_apply=t ;;
        -c)     continue="$2"; resume=f; shift ;;
@@ -76,6 +77,10 @@ do
     *)
            git-mailinfo $keep_subject $utf8 \
                .dotest/msg .dotest/patch <$i >.dotest/info || exit 1
+           test -s .dotest/patch || {
+               echo "Patch is empty.  Was it split wrong?"
+               exit 1
+           }
            git-stripspace < .dotest/msg > .dotest/msg-clean
            ;;
     esac