sequencer: reset the committer date before commits

Now that the sequencer commits without forking when the commit message isn't edited all the commits that are picked have the same committer date. If a commit is reworded it's committer date will be a later time as it is created by running an separate instance of 'git commit'. If the reworded commit is follow by further picks, those later commits will have an earlier committer date than the reworded one. This is caused by git caching the default date used when GIT_COMMITTER_DATE is not set. Reset the cached date before a commit is generated in-process. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Sixt committed Apr 18, 2018 at 20:15 UTC 12f7babd6b68b14012f8beed42d82688c7e8f04a
1 file changed +2
sequencer.c
+2
@@ -1148,6 +1148,8 @@ static int try_to_commit(struct strbuf *msg, const char *author,
1148 goto out;
1149 }
1150
1151 + reset_ident_date();
1152 +
1153 if (commit_tree_extended(msg->buf, msg->len, &tree, parents,
1154 oid, author, opts->gpg_sign, extra)) {
1155 res = error(_("failed to write commit object"));