format-patch: do not use bogus email addresses in message ids

We can ask git_committer_info to be strict about coming up
with an email, which will die automatically on a poorly
configured machine. This is better than letting invalid
message-ids into the wild.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2012-05-24 19:32:52 -04:00 committed by Junio C Hamano
parent 8c5b1ae1b2
commit 59f9b8a9a9

View File

@ -741,7 +741,7 @@ static void gen_message_id(struct rev_info *info, char *base)
struct strbuf buf = STRBUF_INIT;
strbuf_addf(&buf, "%s.%lu.git.%s", base,
(unsigned long) time(NULL),
git_committer_info(IDENT_NO_NAME|IDENT_NO_DATE));
git_committer_info(IDENT_NO_NAME|IDENT_NO_DATE|IDENT_STRICT));
info->message_id = strbuf_detach(&buf, NULL);
}