diff options
| author | Russell Belfer <rb@github.com> | 2013-08-16 14:34:51 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-08-16 15:04:15 -0700 |
| commit | ce23330fd636a99a25b3a6b7c81e63c424ae7d7c (patch) | |
| tree | e1c6bfef45e49d9add6150e59b6bb27902c86f63 /include/git2/signature.h | |
| parent | 68458e422a6070d8f445eb6a4bfaac3310c330a3 (diff) | |
| download | libgit2-ce23330fd636a99a25b3a6b7c81e63c424ae7d7c.tar.gz | |
Add new git_signature_default API using config
This adds a new API for creating a signature that uses the
config to look up "user.name" and "user.email".
Diffstat (limited to 'include/git2/signature.h')
| -rw-r--r-- | include/git2/signature.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/git2/signature.h b/include/git2/signature.h index 00d19de66..2fa46d032 100644 --- a/include/git2/signature.h +++ b/include/git2/signature.h @@ -48,6 +48,19 @@ GIT_EXTERN(int) git_signature_new(git_signature **out, const char *name, const c */ GIT_EXTERN(int) git_signature_now(git_signature **out, const char *name, const char *email); +/** + * 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. + * + * @param out new signature + * @param repo repository pointer + * @return 0 on success, GIT_ENOTFOUND if config is missing, or error code + */ +GIT_EXTERN(int) git_signature_default(git_signature **out, git_repository *repo); /** * Create a copy of an existing signature. All internal strings are also |
