summaryrefslogtreecommitdiff
path: root/src/git2
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-12-12 00:33:57 +0200
committerVicent Marti <tanoku@gmail.com>2010-12-12 00:33:57 +0200
commit5cccfa899926a93c12af8232c0c0d16c0c9c7ff2 (patch)
tree07d4d69319149f500c81d920df268a2f177f794c /src/git2
parente0d9e12e502582d33f3e54bd77b274aaadbd60c6 (diff)
parentb76d984e0bc15440443022aa9facfbab8b976e08 (diff)
downloadlibgit2-5cccfa899926a93c12af8232c0c0d16c0c9c7ff2.tar.gz
Merge branch 'timezone-offset' of https://github.com/nulltoken/libgit2 into timezone
Diffstat (limited to 'src/git2')
-rw-r--r--src/git2/commit.h13
-rw-r--r--src/git2/common.h1
-rw-r--r--src/git2/tag.h3
3 files changed, 14 insertions, 3 deletions
diff --git a/src/git2/commit.h b/src/git2/commit.h
index 728679758..54b0ed872 100644
--- a/src/git2/commit.h
+++ b/src/git2/commit.h
@@ -93,6 +93,13 @@ GIT_EXTERN(const char *) git_commit_message(git_commit *commit);
GIT_EXTERN(time_t) git_commit_time(git_commit *commit);
/**
+ * Get the commit timezone offset (i.e. committer's preferred timezone) of a commit.
+ * @param commit a previously loaded commit.
+ * @return positive or negative timezone offset, in minutes from UTC
+ */
+GIT_EXTERN(int) git_commit_timezone_offset(git_commit *commit);
+
+/**
* Get the committer of a commit.
* @param commit a previously loaded commit.
* @return the committer of a commit
@@ -150,8 +157,9 @@ GIT_EXTERN(void) git_commit_set_message(git_commit *commit, const char *message)
* @param name name of the new committer
* @param email email of the new committer
* @param time time when the committer committed the commit
+ * @param offset committer positive or negative timezone offset, in minutes from UTC
*/
-GIT_EXTERN(void) git_commit_set_committer(git_commit *commit, const char *name, const char *email, time_t time);
+GIT_EXTERN(void) git_commit_set_committer(git_commit *commit, const char *name, const char *email, time_t time, int offset);
/**
* Set the author of a commit
@@ -159,8 +167,9 @@ GIT_EXTERN(void) git_commit_set_committer(git_commit *commit, const char *name,
* @param name name of the new author
* @param email email of the new author
* @param time time when the author created the commit
+ * @param offset author positive or negative timezone offset, in minutes from UTC
*/
-GIT_EXTERN(void) git_commit_set_author(git_commit *commit, const char *name, const char *email, time_t time);
+GIT_EXTERN(void) git_commit_set_author(git_commit *commit, const char *name, const char *email, time_t time, int offset);
/**
* Set the tree which is pointed to by a commit
diff --git a/src/git2/common.h b/src/git2/common.h
index b819f0549..9734074ca 100644
--- a/src/git2/common.h
+++ b/src/git2/common.h
@@ -143,6 +143,7 @@ typedef struct git_person git_person;
const char *git_person_name(git_person *person);
const char *git_person_email(git_person *person);
time_t git_person_time(git_person *person);
+int git_person_timezone_offset(git_person *person);
/** @} */
GIT_END_DECL
diff --git a/src/git2/tag.h b/src/git2/tag.h
index 39b45ac74..d78235e81 100644
--- a/src/git2/tag.h
+++ b/src/git2/tag.h
@@ -125,8 +125,9 @@ GIT_EXTERN(void) git_tag_set_name(git_tag *tag, const char *name);
* @param name the name of the new tagger
* @param email the email of the new tagger
* @param time the time when the tag was created
+ * @param offset tagger positive or negative timezone offset, in minutes from UTC
*/
-GIT_EXTERN(void) git_tag_set_tagger(git_tag *tag, const char *name, const char *email, time_t time);
+GIT_EXTERN(void) git_tag_set_tagger(git_tag *tag, const char *name, const char *email, time_t time, int offset);
/**
* Set the message of a tag