summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2018-04-18 18:15:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-18 22:36:32 (GMT)
commit12f7babd6b68b14012f8beed42d82688c7e8f04a (patch)
tree2a97d25aa561fe8fec23eb12952a02a06bf8b7f6 /sequencer.c
parent468165c1d8a442994a825f3684528361727cd8c0 (diff)
downloadgit-12f7babd6b68b14012f8beed42d82688c7e8f04a.zip
git-12f7babd6b68b14012f8beed42d82688c7e8f04a.tar.gz
git-12f7babd6b68b14012f8beed42d82688c7e8f04a.tar.bz2
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>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index f9d1001..f0bac90 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -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"));