libgit2

git_signature_default

Version:

Create a new action signature with default user and now timestamp.

This looks up the user.name and user.email from the configuration and uses the current time as the timestamp, and creates a new signature based on that information. It will return GIT_ENOTFOUND if either the user.name or user.email are not set.

Note that these do not examine environment variables, only the configuration files. Use git_signature_default_from_env to consider the environment variables.

Signature

int git_signature_default(git_signature **out, git_repository *repo);

Parameters

In
out

new signature

In
repo

repository pointer

Returns

int

0 on success, GIT_ENOTFOUND if config is missing, or error code

Versions