summaryrefslogtreecommitdiff
path: root/include/git2/commit.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-08-12 16:24:19 -0700
committerVicent Marti <tanoku@gmail.com>2011-08-12 16:24:19 -0700
commit5ae2f0c0135758020c46091491068a009e8ac10b (patch)
tree0369e72bc132c8cdb7133c6c5c3eb12285926e22 /include/git2/commit.h
parentb2e60e4eb5efc2d8ab78371ecd85e8a1f482134d (diff)
downloadlibgit2-5ae2f0c0135758020c46091491068a009e8ac10b.tar.gz
commit: Add support for Encoding header
Diffstat (limited to 'include/git2/commit.h')
-rw-r--r--include/git2/commit.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h
index 84adef596..12646cf58 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -97,12 +97,16 @@ GIT_INLINE(void) git_commit_close(git_commit *commit)
GIT_EXTERN(const git_oid *) git_commit_id(git_commit *commit);
/**
- * Get the short (one line) message of a commit.
+ * Get the encoding for the message of a commit,
+ * as a string representing a standard encoding name.
+ *
+ * The encoding may be NULL if the `encoding` header
+ * in the commit is missing; in that case UTF-8 is assumed.
*
* @param commit a previously loaded commit.
- * @return the short message of a commit
+ * @return NULL, or the encoding
*/
-GIT_EXTERN(const char *) git_commit_message_short(git_commit *commit);
+GIT_EXTERN(const char *) git_commit_message_encoding(git_commit *commit);
/**
* Get the full message of a commit.
@@ -213,6 +217,11 @@ GIT_EXTERN(const git_oid *) git_commit_parent_oid(git_commit *commit, unsigned i
* @param committer Signature representing the committer and the
* commit time of this commit
*
+ * @param message_encoding The encoding for the message in the
+ * commit, represented with a standard encoding name.
+ * E.g. "UTF-8". If NULL, no encoding header is written and
+ * UTF-8 is assumed.
+ *
* @param message Full message for this commit
*
* @param tree An instance of a `git_tree` object that will
@@ -236,6 +245,7 @@ GIT_EXTERN(int) git_commit_create(
const char *update_ref,
const git_signature *author,
const git_signature *committer,
+ const char *message_encoding,
const char *message,
const git_tree *tree,
int parent_count,
@@ -260,6 +270,7 @@ GIT_EXTERN(int) git_commit_create_v(
const char *update_ref,
const git_signature *author,
const git_signature *committer,
+ const char *message_encoding,
const char *message,
const git_tree *tree,
int parent_count,