mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
signature: add git_signature_default_from_env
People who are doing a commit expect a unified timestamp between author and committer information when we're using the current timestamp. Provide a single function that returns both author and committer information so that they can have an identical timestamp when none is specified in the environment.
This commit is contained in:
@@ -130,8 +130,7 @@ static void create_initial_commit(git_repository *repo)
|
||||
|
||||
/** First use the config to initialize a commit signature for the user. */
|
||||
|
||||
if ((git_signature_default_author(&author_sig, repo) < 0) ||
|
||||
(git_signature_default_committer(&committer_sig, repo) < 0))
|
||||
if ((git_signature_default_from_env(&author_sig, &committer_sig, repo) < 0))
|
||||
fatal("Unable to create a commit signature.",
|
||||
"Perhaps 'user.name' and 'user.email' are not set");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user