summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-04-17 17:33:51 +0200
committerVicent Marti <tanoku@gmail.com>2013-04-17 17:33:51 +0200
commit3be933b143731bbe3a5cadcdf70b8ab205a629c0 (patch)
tree9688ce16cb1fa2ee16499d20e5d501a2f3d98d90 /include/git2
parentf124ebd457bfbf43de3516629aaba5a279636e04 (diff)
downloadlibgit2-3be933b143731bbe3a5cadcdf70b8ab205a629c0.tar.gz
refs: Add `git_referene_target_peel`
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/refdb.h7
-rw-r--r--include/git2/refs.h11
2 files changed, 17 insertions, 1 deletions
diff --git a/include/git2/refdb.h b/include/git2/refdb.h
index 0586b119e..76b8fda0d 100644
--- a/include/git2/refdb.h
+++ b/include/git2/refdb.h
@@ -35,7 +35,12 @@ GIT_EXTERN(git_reference *) git_reference__alloc(
git_refdb *refdb,
const char *name,
const git_oid *oid,
- const char *symbolic);
+ const git_oid *peel);
+
+GIT_EXTERN(git_reference *) git_reference__alloc_symbolic(
+ git_refdb *refdb,
+ const char *name,
+ const char *target);
/**
* Create a new reference database with no backends.
diff --git a/include/git2/refs.h b/include/git2/refs.h
index e0451ba82..1ff0d4544 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -133,6 +133,17 @@ GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo,
GIT_EXTERN(const git_oid *) git_reference_target(const git_reference *ref);
/**
+ * Return the peeled OID target of this reference.
+ *
+ * This peeled OID only applies to direct references that point to
+ * a hard Tag object: it is the result of peeling such Tag.
+ *
+ * @param ref The reference
+ * @return a pointer to the oid if available, NULL otherwise
+ */
+GIT_EXTERN(const git_oid *) git_reference_target_peel(const git_reference *ref);
+
+/**
* Get full name to the reference pointed to by a symbolic reference.
*
* Only available if the reference is symbolic.