commit 892eab0a82532775a97ff23efda990ad80d35896 from: Stefan Sperling via: Thomas Adam date: Fri Jul 22 09:11:02 2022 UTC call time(3) just once in commit_worktree(), not twice commit - f4e6231a850cc8e3edfb791f86ca3f8f4a9d6245 commit + 892eab0a82532775a97ff23efda990ad80d35896 blob - 6efb1b06ff7d7a6f0d2b9add9dead5af05ec06c5 blob + 875f3a44d943bf9d22d49348e181c903e9e42088 --- lib/worktree.c +++ lib/worktree.c @@ -5679,6 +5679,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; @@ -5747,8 +5748,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)