send-email: extract email-parsing code into a subroutine
commitb6049542b97e7b135e0e82bf996084d461224d32
authorNathan Payre <nathan.payre@etu.univ-lyon1.fr>
Fri, 15 Dec 2017 15:33:39 +0000 (15 16:33 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Dec 2017 18:46:53 +0000 (15 10:46 -0800)
treefc61bdbd9ff4e8dfd2188b98aab4b0ae50e8bf29
parent52015aaf9d19c97b52c47c7046058e6d029ff856
send-email: extract email-parsing code into a subroutine

The existing code mixes parsing of email header with regular
expression and actual code. Extract the parsing code into a new
subroutine "parse_header_line()". This improves the code readability
and make parse_header_line reusable in other place.

"parsed_header_line()" and "filter_body()" could be used for
refactoring the part of code which parses the header to prepare the
email and send it.

In contrast to the previous version it doesn't keep the header order
and strip duplicate headers.

Signed-off-by: Nathan Payre <nathan.payre@etu.univ-lyon1.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@univ-lyon1.fr>
Signed-off-by: Timothee Albertin <timothee.albertin@etu.univ-lyon1.fr>
Signed-off-by: Daniel Bensoussan <daniel.bensoussan--bohm@etu.univ-lyon1.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Matthieu Moy <matthieu.moy@univ-lyon1.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl