summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-11-09 22:06:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-09 22:06:28 (GMT)
commit6a44c9c0d05839d6402c84a80acd0c2525f3a85e (patch)
tree279ceac5ea54acc3973123fd3e801dfd1c974c10 /sequencer.c
parentecf95d938b390e1ee7c1df78b9ebe3a59ffd44c9 (diff)
parent2020451c5bcc5289b8e6f25c7092d4fdb702257a (diff)
downloadgit-6a44c9c0d05839d6402c84a80acd0c2525f3a85e.zip
git-6a44c9c0d05839d6402c84a80acd0c2525f3a85e.tar.gz
git-6a44c9c0d05839d6402c84a80acd0c2525f3a85e.tar.bz2
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 'sequencer.c')
-rw-r--r--sequencer.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/sequencer.c b/sequencer.c
index a65d7a6..1244396 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -314,8 +314,6 @@ int sequencer_remove_state(struct replay_opts *opts)
}
}
- free(opts->committer_name);
- free(opts->committer_email);
free(opts->gpg_sign);
free(opts->strategy);
for (i = 0; i < opts->xopts_nr; i++)
@@ -1460,8 +1458,8 @@ static int try_to_commit(struct repository *r,
} else {
reset_ident_date();
}
- committer = fmt_ident(opts->committer_name,
- opts->committer_email,
+ committer = fmt_ident(getenv("GIT_COMMITTER_NAME"),
+ getenv("GIT_COMMITTER_EMAIL"),
WANT_COMMITTER_IDENT,
opts->ignore_date ? NULL : date.buf,
IDENT_STRICT);
@@ -4468,22 +4466,6 @@ static int commit_staged_changes(struct repository *r,
return 0;
}
-static int init_committer(struct replay_opts *opts)
-{
- struct ident_split id;
- const char *committer;
-
- committer = git_committer_info(IDENT_STRICT);
- if (split_ident_line(&id, committer, strlen(committer)) < 0)
- return error(_("invalid committer '%s'"), committer);
- opts->committer_name =
- xmemdupz(id.name_begin, id.name_end - id.name_begin);
- opts->committer_email =
- xmemdupz(id.mail_begin, id.mail_end - id.mail_begin);
-
- return 0;
-}
-
int sequencer_continue(struct repository *r, struct replay_opts *opts)
{
struct todo_list todo_list = TODO_LIST_INIT;
@@ -4495,9 +4477,6 @@ int sequencer_continue(struct repository *r, struct replay_opts *opts)
if (read_populate_opts(opts))
return -1;
if (is_rebase_i(opts)) {
- if (opts->committer_date_is_author_date && init_committer(opts))
- return -1;
-
if ((res = read_populate_todo(r, &todo_list, opts)))
goto release_todo_list;
@@ -5392,9 +5371,6 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
res = -1;
- if (opts->committer_date_is_author_date && init_committer(opts))
- goto cleanup;
-
if (checkout_onto(r, opts, onto_name, &oid, orig_head))
goto cleanup;