am: fix broken email with --committer-date-is-author-date
commit16b0bb99eac5ebd02a5dcabdff2cfc390e9d92ef
authorJeff King <peff@peff.net>
Fri, 23 Oct 2020 07:09:39 +0000 (23 03:09 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 Oct 2020 15:25:19 +0000 (23 08:25 -0700)
treed0e42501b1cf65395e91e22e74f75fc5caa0286e
parent56706dba33f5d4457395c651cf1cd033c6c03c7a
am: fix broken email with --committer-date-is-author-date

Commit e8cbe2118a (am: stop exporting GIT_COMMITTER_DATE, 2020-08-17)
rewrote the code for setting the committer date to use fmt_ident(),
rather than setting an environment variable and letting commit_tree()
handle it. But it introduced two bugs:

  - we use the author email string instead of the committer email

  - when parsing the committer ident, we used the wrong variable to
    compute the length of the email, resulting in it always being a
    zero-length string

This commit fixes both, which causes our test of this option via the
rebase "apply" backend to now succeed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c
t/t3436-rebase-more-options.sh