[libgit2-glib] Bind ggit_ref_get_shorthand
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Bind ggit_ref_get_shorthand
- Date: Thu, 16 Jan 2014 18:58:26 +0000 (UTC)
commit bff1af73a2d560eb4cd969b4a534d9a460575395
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Thu Jan 16 19:57:17 2014 +0100
Bind ggit_ref_get_shorthand
libgit2-glib/ggit-ref.c | 16 ++++++++++++++++
libgit2-glib/ggit-ref.h | 1 +
2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-ref.c b/libgit2-glib/ggit-ref.c
index 67405f4..01a6169 100644
--- a/libgit2-glib/ggit-ref.c
+++ b/libgit2-glib/ggit-ref.c
@@ -153,6 +153,22 @@ ggit_ref_get_name (GgitRef *ref)
}
/**
+ * ggit_ref_get_shorthand:
+ * @ref: a #GgitRef
+ *
+ * Gets the shorthand name of @ref.
+ *
+ * Returns: the shorthand name of a reference.
+ */
+const gchar *
+ggit_ref_get_shorthand (GgitRef *ref)
+{
+ g_return_val_if_fail (ref != NULL, NULL);
+
+ return git_reference_shorthand (_ggit_native_get (ref));
+}
+
+/**
* ggit_ref_to_string:
* @ref: a #GgitRef.
*
diff --git a/libgit2-glib/ggit-ref.h b/libgit2-glib/ggit-ref.h
index 616a56b..e3b82ca 100644
--- a/libgit2-glib/ggit-ref.h
+++ b/libgit2-glib/ggit-ref.h
@@ -71,6 +71,7 @@ const gchar *ggit_ref_get_symbolic_target(GgitRef *ref);
GgitRefType ggit_ref_get_reference_type (GgitRef *ref);
const gchar *ggit_ref_get_name (GgitRef *ref);
+const gchar *ggit_ref_get_shorthand (GgitRef *ref);
const gchar *ggit_ref_to_string (GgitRef *ref);
GgitRef *ggit_ref_resolve (GgitRef *ref,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]