From: Paul Tan Date: Tue, 4 Aug 2015 13:51:27 +0000 (+0800) Subject: builtin-am: auto-detect mbox patches X-Git-Tag: v2.6.0-rc0~77^2~40 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c29807b27dc60e17eb1cd8bc50900af2a09ce66f?ds=inline;hp=c29807b27dc60e17eb1cd8bc50900af2a09ce66f builtin-am: auto-detect mbox patches Since 15ced75 (git-am foreign patch support: autodetect some patch formats, 2009-05-27), git-am.sh is able to autodetect mbox, stgit and mercurial patches through heuristics. Re-implement support for autodetecting mbox/maildir files in builtin/am.c. RFC 2822 requires that lines are terminated by "\r\n". To support this, implement strbuf_getline_crlf(), which will remove both '\n' and "\r\n" from the end of the line. Helped-by: Junio C Hamano Helped-by: Eric Sunshine Helped-by: Johannes Schindelin Signed-off-by: Paul Tan Signed-off-by: Junio C Hamano ---