1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-23 23:06:12 +02:00

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>
This commit is contained in:
Johannes Sixt 2018-04-18 20:15:04 +02:00 committed by Junio C Hamano
parent 468165c1d8
commit 12f7babd6b

View File

@ -1148,6 +1148,8 @@ static int try_to_commit(struct strbuf *msg, const char *author,
goto out;
}
reset_ident_date();
if (commit_tree_extended(msg->buf, msg->len, &tree, parents,
oid, author, opts->gpg_sign, extra)) {
res = error(_("failed to write commit object"));