[libgit2-glib] Bind ggit_ref_is_branch/remote/tag



commit fdc6c2abe8429c71993f3d7f690d4edc9975634b
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Thu Jan 16 19:57:28 2014 +0100

    Bind ggit_ref_is_branch/remote/tag

 libgit2-glib/ggit-ref.c |   51 +++++++++++++++++++++++++++++++++++++++++++++++
 libgit2-glib/ggit-ref.h |    4 +++
 2 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-ref.c b/libgit2-glib/ggit-ref.c
index 01a6169..75d8f7b 100644
--- a/libgit2-glib/ggit-ref.c
+++ b/libgit2-glib/ggit-ref.c
@@ -526,4 +526,55 @@ ggit_ref_delete_reflog (GgitRef  *ref,
        }
 }
 
+/**
+ * ggit_ref_is_tag:
+ * @ref: a #GgitRef.
+ *
+ * Check whether the reference is a tag.
+ *
+ * Returns: %TRUE if the reference is a tag, %FALSE otherwise.
+ *
+ **/
+gboolean
+ggit_ref_is_tag (GgitRef *ref)
+{
+       g_return_val_if_fail (ref != NULL, FALSE);
+
+       return git_reference_is_tag (_ggit_native_get (ref));
+}
+
+/**
+ * ggit_ref_is_remote:
+ * @ref: a #GgitRef.
+ *
+ * Check whether the reference is a remote.
+ *
+ * Returns: %TRUE if the reference is a remote, %FALSE otherwise.
+ *
+ **/
+gboolean
+ggit_ref_is_remote (GgitRef *ref)
+{
+       g_return_val_if_fail (ref != NULL, FALSE);
+
+       return git_reference_is_remote (_ggit_native_get (ref));
+}
+
+/**
+ * ggit_ref_is_branch:
+ * @ref: a #GgitRef.
+ *
+ * Check whether the reference is a branch.
+ *
+ * Returns: %TRUE if the reference is a branch, %FALSE otherwise.
+ *
+ **/
+gboolean
+ggit_ref_is_branch (GgitRef *ref)
+{
+       g_return_val_if_fail (ref != NULL, FALSE);
+
+       return git_reference_is_branch (_ggit_native_get (ref));
+}
+
 /* ex:set ts=8 noet: */
diff --git a/libgit2-glib/ggit-ref.h b/libgit2-glib/ggit-ref.h
index e3b82ca..d43fca9 100644
--- a/libgit2-glib/ggit-ref.h
+++ b/libgit2-glib/ggit-ref.h
@@ -106,6 +106,10 @@ GgitReflog     *ggit_ref_get_reflog         (GgitRef        *ref,
 void            ggit_ref_delete_reflog      (GgitRef        *ref,
                                              GError        **error);
 
+gboolean        ggit_ref_is_tag             (GgitRef        *ref);
+gboolean        ggit_ref_is_remote          (GgitRef        *ref);
+gboolean        ggit_ref_is_branch          (GgitRef        *ref);
+
 G_END_DECLS
 
 #endif /* __GGIT_REF_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]