diff options
| author | Junio C Hamano <gitster@pobox.com> | 2009-08-10 22:16:42 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2009-08-10 22:16:42 -0700 |
| commit | 38a9f35d1f7d2d90dafbbf4c45ac9500260eaeb0 (patch) | |
| tree | b24682291118c45ff0281d1e68a6e2d7b4dad521 /git-am.sh | |
| parent | efd3f9fdbcc1f4fc8b423dfa4e73f11a18d0500f (diff) | |
| parent | 46caf5053f0a784911c66530928e6e4361a783f2 (diff) | |
| download | git-38a9f35d1f7d2d90dafbbf4c45ac9500260eaeb0.tar.gz | |
Merge branch 'ns/am-raw-email'
* ns/am-raw-email:
git-am: print fair error message when format detection fails
am: allow individual e-mail files as input
Diffstat (limited to 'git-am.sh')
| -rwxr-xr-x | git-am.sh | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -191,6 +191,20 @@ check_patch_format () { esac ;; esac + if test -z "$patch_format" && + test -n "$l1" && + test -n "$l2" && + test -n "$l3" + then + # This begins with three non-empty lines. Is this a + # piece of e-mail a-la RFC2822? Grab all the headers, + # discarding the indented remainder of folded lines, + # and see if it looks like that they all begin with the + # header field names... + sed -n -e '/^$/q' -e '/^[ ]/d' -e p "$1" | + egrep -v '^[A-Za-z]+(-[A-Za-z]+)*:' >/dev/null || + patch_format=mbox + fi } < "$1" || clean_abort } @@ -254,7 +268,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 } |
