]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/am.c
builtin-am: auto-detect mbox patches
authorPaul Tan <pyokagan@gmail.com>
Tue, 4 Aug 2015 13:51:27 +0000 (21:51 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Aug 2015 05:02:11 +0000 (22:02 -0700)
commitc29807b27dc60e17eb1cd8bc50900af2a09ce66f
tree1793937d7f01ea18b728cbfd1401ca467537ee90
parent11c2177f2c264513f8d3abe64666fa05bcd84a57
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 <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c