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:
@@ -63,10 +63,8 @@ int lg2_commit(git_repository *repo, int argc, char **argv)
|
||||
|
||||
check_lg2(git_tree_lookup(&tree, repo, &tree_oid), "Error looking up tree", NULL);
|
||||
|
||||
check_lg2(git_signature_default_author(&author_signature, repo),
|
||||
"Error creating author signature", NULL);
|
||||
check_lg2(git_signature_default_committer(&committer_signature, repo),
|
||||
"Error creating committer signature", NULL);
|
||||
check_lg2(git_signature_default_from_env(&author_signature, &committer_signature, repo),
|
||||
"Error creating signature", NULL);
|
||||
|
||||
check_lg2(git_commit_create_v(
|
||||
&commit_oid,
|
||||
|
||||
Reference in New Issue
Block a user