diff options
author | Vicent Marti <tanoku@gmail.com> | 2012-11-17 19:54:47 -0800 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-11-27 13:18:27 -0800 |
commit | cfbe4be3fb639d96587974794fe437ace0c383c4 (patch) | |
tree | 1dcc1a4462075a7832d4cb853634af00fb78e7b1 /include/git2/commit.h | |
parent | 2508cc66eb91597b12dc19721d9cea1f06e72107 (diff) | |
download | libgit2-cfbe4be3fb639d96587974794fe437ace0c383c4.tar.gz |
More external API cleanup
Conflicts:
src/branch.c
tests-clar/refs/branches/create.c
Diffstat (limited to 'include/git2/commit.h')
-rw-r--r-- | include/git2/commit.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h index a159b79e1..872f691ce 100644 --- a/include/git2/commit.h +++ b/include/git2/commit.h @@ -76,7 +76,10 @@ GIT_INLINE(void) git_commit_free(git_commit *commit) * @param commit a previously loaded commit. * @return object identity for the commit. */ -GIT_EXTERN(const git_oid *) git_commit_id(git_commit *commit); +GIT_INLINE(const git_oid *) git_commit_id(const git_commit *commit) +{ + return git_object_id((const git_object *)commit); +} /** * Get the encoding for the message of a commit, @@ -88,7 +91,7 @@ GIT_EXTERN(const git_oid *) git_commit_id(git_commit *commit); * @param commit a previously loaded commit. * @return NULL, or the encoding */ -GIT_EXTERN(const char *) git_commit_message_encoding(git_commit *commit); +GIT_EXTERN(const char *) git_commit_message_encoding(const git_commit *commit); /** * Get the full message of a commit. @@ -96,7 +99,7 @@ GIT_EXTERN(const char *) git_commit_message_encoding(git_commit *commit); * @param commit a previously loaded commit. * @return the message of a commit */ -GIT_EXTERN(const char *) git_commit_message(git_commit *commit); +GIT_EXTERN(const char *) git_commit_message(const git_commit *commit); /** * Get the commit time (i.e. committer time) of a commit. @@ -104,7 +107,7 @@ GIT_EXTERN(const char *) git_commit_message(git_commit *commit); * @param commit a previously loaded commit. * @return the time of a commit */ -GIT_EXTERN(git_time_t) git_commit_time(git_commit *commit); +GIT_EXTERN(git_time_t) git_commit_time(const git_commit *commit); /** * Get the commit timezone offset (i.e. committer's preferred timezone) of a commit. @@ -112,7 +115,7 @@ GIT_EXTERN(git_time_t) git_commit_time(git_commit *commit); * @param commit a previously loaded commit. * @return positive or negative timezone offset, in minutes from UTC */ -GIT_EXTERN(int) git_commit_time_offset(git_commit *commit); +GIT_EXTERN(int) git_commit_time_offset(const git_commit *commit); /** * Get the committer of a commit. @@ -120,7 +123,7 @@ GIT_EXTERN(int) git_commit_time_offset(git_commit *commit); * @param commit a previously loaded commit. * @return the committer of a commit */ -GIT_EXTERN(const git_signature *) git_commit_committer(git_commit *commit); +GIT_EXTERN(const git_signature *) git_commit_committer(const git_commit *commit); /** * Get the author of a commit. @@ -128,7 +131,7 @@ GIT_EXTERN(const git_signature *) git_commit_committer(git_commit *commit); * @param commit a previously loaded commit. * @return the author of a commit */ -GIT_EXTERN(const git_signature *) git_commit_author(git_commit *commit); +GIT_EXTERN(const git_signature *) git_commit_author(const git_commit *commit); /** * Get the tree pointed to by a commit. @@ -137,7 +140,7 @@ GIT_EXTERN(const git_signature *) git_commit_author(git_commit *commit); * @param commit a previously loaded commit. * @return 0 or an error code */ -GIT_EXTERN(int) git_commit_tree(git_tree **tree_out, git_commit *commit); +GIT_EXTERN(int) git_commit_tree(git_tree **tree_out, const git_commit *commit); /** * Get the id of the tree pointed to by a commit. This differs from @@ -147,7 +150,7 @@ GIT_EXTERN(int) git_commit_tree(git_tree **tree_out, git_commit *commit); * @param commit a previously loaded commit. * @return the id of tree pointed to by commit. */ -GIT_EXTERN(const git_oid *) git_commit_tree_oid(git_commit *commit); +GIT_EXTERN(const git_oid *) git_commit_tree_id(const git_commit *commit); /** * Get the number of parents of this commit @@ -155,17 +158,17 @@ GIT_EXTERN(const git_oid *) git_commit_tree_oid(git_commit *commit); * @param commit a previously loaded commit. * @return integer of count of parents */ -GIT_EXTERN(unsigned int) git_commit_parentcount(git_commit *commit); +GIT_EXTERN(unsigned int) git_commit_parentcount(const git_commit *commit); /** * Get the specified parent of the commit. * - * @param parent Pointer where to store the parent commit + * @param out Pointer where to store the parent commit * @param commit a previously loaded commit. * @param n the position of the parent (from 0 to `parentcount`) * @return 0 or an error code */ -GIT_EXTERN(int) git_commit_parent(git_commit **parent, git_commit *commit, unsigned int n); +GIT_EXTERN(int) git_commit_parent(git_commit **out, git_commit *commit, unsigned int n); /** * Get the oid of a specified parent for a commit. This is different from @@ -176,7 +179,7 @@ GIT_EXTERN(int) git_commit_parent(git_commit **parent, git_commit *commit, unsig * @param n the position of the parent (from 0 to `parentcount`) * @return the id of the parent, NULL on error. */ -GIT_EXTERN(const git_oid *) git_commit_parent_oid(git_commit *commit, unsigned int n); +GIT_EXTERN(const git_oid *) git_commit_parent_id(git_commit *commit, unsigned int n); /** * Get the commit object that is the <n>th generation ancestor @@ -204,7 +207,7 @@ GIT_EXTERN(int) git_commit_nth_gen_ancestor( * The message will not be cleaned up. This can be achieved * through `git_message_prettify()`. * - * @param oid Pointer where to store the OID of the + * @param id Pointer where to store the OID of the * newly created commit * * @param repo Repository where to store the commit @@ -245,7 +248,7 @@ GIT_EXTERN(int) git_commit_nth_gen_ancestor( * the given reference will be updated to point to it */ GIT_EXTERN(int) git_commit_create( - git_oid *oid, + git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, @@ -273,7 +276,7 @@ GIT_EXTERN(int) git_commit_create( * @see git_commit_create */ GIT_EXTERN(int) git_commit_create_v( - git_oid *oid, + git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, |