diff options
author | Etienne Samson <samson.etienne@gmail.com> | 2018-06-23 13:06:10 +0000 |
---|---|---|
committer | Etienne Samson <samson.etienne@gmail.com> | 2018-07-07 13:10:50 +0200 |
commit | 698b44639e499b23d882f8a26f3ca5fd4d94f22e (patch) | |
tree | 4d89f2c1d44e1e61bc062bf918915272b53f78a1 /include | |
parent | f4633791104fa5be75115fd4c7fab0c097da345e (diff) | |
download | libgit2-698b44639e499b23d882f8a26f3ca5fd4d94f22e.tar.gz |
annotated_commit: make the refname accessible
As git_annotated_commit seems to behave like cgit's refish, it's quite
helpful to abstract away "targets" via git_annotated_commit_from_id/from_ref.
As the former is accessible via git_annotated_commit_id, make the latter
also available to users.
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/annotated_commit.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/git2/annotated_commit.h b/include/git2/annotated_commit.h index 7fb896a5f..fa795bfc4 100644 --- a/include/git2/annotated_commit.h +++ b/include/git2/annotated_commit.h @@ -104,6 +104,15 @@ GIT_EXTERN(const git_oid *) git_annotated_commit_id( const git_annotated_commit *commit); /** + * Get the refname that the given `git_annotated_commit` refers to. + * + * @param commit the given annotated commit + * @return ref name. + */ +GIT_EXTERN(const char *) git_annotated_commit_ref( + const git_annotated_commit *commit); + +/** * Frees a `git_annotated_commit`. * * @param commit annotated commit to free |