diff options
author | Carlos Martín Nieto <cmn@elego.de> | 2011-04-05 16:15:54 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-04-09 15:29:48 -0700 |
commit | 9e9e6ae177332f5c1311eff9c9b5ca9740e04dbd (patch) | |
tree | 6f596a98ec7cb2fc67614bf805f3b4859b67f609 /include/git2/signature.h | |
parent | b5c00c6d41ff4eb809f7deda38fe61ccaacb7cbf (diff) | |
download | libgit2-9e9e6ae177332f5c1311eff9c9b5ca9740e04dbd.tar.gz |
Add API git_signature_new_now
Most tags will have a timestamp of whenever the code is running and
dealing with time and timezones is error-prone. Optimize for this case
by adding a function which causes the signature to be created with a
current timestamp.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Diffstat (limited to 'include/git2/signature.h')
-rw-r--r-- | include/git2/signature.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/git2/signature.h b/include/git2/signature.h index b0995c8b2..013ce7460 100644 --- a/include/git2/signature.h +++ b/include/git2/signature.h @@ -50,6 +50,17 @@ GIT_BEGIN_DECL GIT_EXTERN(git_signature *) git_signature_new(const char *name, const char *email, git_time_t time, int offset); /** + * Create a new action signature with a timestamp of 'now'. The + * signature must be freed manually or using git_signature_free + * + * @param name name of the person + * @param email email of the person + * @return the new sig, NULL on out of memory + */ +GIT_EXTERN(git_signature *) git_signature_new_now(const char *name, const char *email); + + +/** * Create a copy of an existing signature. * * All internal strings are also duplicated. |