diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-11-10 01:06:27 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-10 01:06:28 +0300 |
commit | 6a44c9c0d05839d6402c84a80acd0c2525f3a85e (patch) | |
tree | 279ceac5ea54acc3973123fd3e801dfd1c974c10 /builtin/am.c | |
parent | ecf95d938b390e1ee7c1df78b9ebe3a59ffd44c9 (diff) | |
parent | 2020451c5bcc5289b8e6f25c7092d4fdb702257a (diff) |
Merge branch 'jk/committer-date-is-author-date-fix-simplify'
Code simplification.
* jk/committer-date-is-author-date-fix-simplify:
am, sequencer: stop parsing our own committer ident
Diffstat (limited to 'builtin/am.c')
-rw-r--r-- | builtin/am.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/builtin/am.c b/builtin/am.c index b727449aed..f22c73a05b 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -98,8 +98,6 @@ struct am_state { char *author_name; char *author_email; char *author_date; - char *committer_name; - char *committer_email; char *msg; size_t msg_len; @@ -132,8 +130,6 @@ struct am_state { */ static void am_state_init(struct am_state *state) { - const char *committer; - struct ident_split id; int gpgsign; memset(state, 0, sizeof(*state)); @@ -154,14 +150,6 @@ static void am_state_init(struct am_state *state) if (!git_config_get_bool("commit.gpgsign", &gpgsign)) state->sign_commit = gpgsign ? "" : NULL; - - committer = git_committer_info(IDENT_STRICT); - if (split_ident_line(&id, committer, strlen(committer)) < 0) - die(_("invalid committer: %s"), committer); - state->committer_name = - xmemdupz(id.name_begin, id.name_end - id.name_begin); - state->committer_email = - xmemdupz(id.mail_begin, id.mail_end - id.mail_begin); } /** @@ -173,8 +161,6 @@ static void am_state_release(struct am_state *state) free(state->author_name); free(state->author_email); free(state->author_date); - free(state->committer_name); - free(state->committer_email); free(state->msg); strvec_clear(&state->git_apply_opts); } @@ -1594,8 +1580,9 @@ static void do_commit(const struct am_state *state) IDENT_STRICT); if (state->committer_date_is_author_date) - committer = fmt_ident(state->committer_name, - state->committer_email, WANT_COMMITTER_IDENT, + committer = fmt_ident(getenv("GIT_COMMITTER_NAME"), + getenv("GIT_COMMITTER_EMAIL"), + WANT_COMMITTER_IDENT, state->ignore_date ? NULL : state->author_date, IDENT_STRICT); |