commit f8399b8f3e641c8eb8f0a50bc42f648efeb7eacc from: Stefan Sperling date: Fri Jul 22 07:40:52 2022 UTC call time(3) just once in commit_worktree(), not twice commit - dff918251f8c81f6d1a277cf8e9f4f348ebee837 commit + f8399b8f3e641c8eb8f0a50bc42f648efeb7eacc blob - cc19332e99847eb9da2ce2e427552b4b000d5413 blob + 53f65daa1c21126c75a38e5bba6ad6178b67fb9c --- lib/worktree.c +++ lib/worktree.c @@ -5681,6 +5681,7 @@ commit_worktree(struct got_object_id **new_commit_id, struct got_object_id_queue parent_ids; struct got_object_qid *pid = NULL; char *logmsg = NULL; + time_t timestamp; *new_commit_id = NULL; @@ -5749,8 +5750,9 @@ commit_worktree(struct got_object_id **new_commit_id, STAILQ_INSERT_TAIL(&parent_ids, pid, entry); nparents++; } + timestamp = time(NULL); err = got_object_commit_create(new_commit_id, new_tree_id, &parent_ids, - nparents, author, time(NULL), committer, time(NULL), logmsg, repo); + nparents, author, timestamp, committer, timestamp, logmsg, repo); if (logmsg != NULL) free(logmsg); if (err)