[libgit2-glib] ref: add ggit_ref_has_log



commit c95ef9a909e2c66cb89f3b7a7127c4103f9be81c
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Jun 23 16:28:57 2014 +0200

    ref: add ggit_ref_has_log

 libgit2-glib/ggit-ref.c |   22 ++++++++++++++++++++++
 libgit2-glib/ggit-ref.h |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-ref.c b/libgit2-glib/ggit-ref.c
index d2ad648..95dfc71 100644
--- a/libgit2-glib/ggit-ref.c
+++ b/libgit2-glib/ggit-ref.c
@@ -464,6 +464,28 @@ ggit_ref_lookup (GgitRef  *ref,
 }
 
 /**
+ * ggit_ref_has_log:
+ * @ref: a #GgitRef.
+ *
+ * Get whether @ref has an existing log.
+ *
+ * Returns: %TRUE if @ref has a log, %FALSE otherwise.
+ *
+ **/
+gboolean
+ggit_ref_has_log (GgitRef *ref)
+{
+       git_reference *nref;
+
+       g_return_val_if_fail (GGIT_IS_REF (ref), FALSE);
+
+       nref = _ggit_native_get (ref);
+
+       return git_reference_has_log (git_reference_owner (nref),
+                                     git_reference_name (nref)) == 1;
+}
+
+/**
  * ggit_ref_get_log:
  * @ref: a #GgitRef.
  * @error: a #GError for error reporting, or %NULL.
diff --git a/libgit2-glib/ggit-ref.h b/libgit2-glib/ggit-ref.h
index e87ff21..386f5a3 100644
--- a/libgit2-glib/ggit-ref.h
+++ b/libgit2-glib/ggit-ref.h
@@ -104,6 +104,8 @@ void            ggit_ref_delete             (GgitRef        *ref,
 GgitObject     *ggit_ref_lookup             (GgitRef        *ref,
                                              GError        **error);
 
+gboolean        ggit_ref_has_log            (GgitRef        *ref);
+
 GgitReflog     *ggit_ref_get_log            (GgitRef        *ref,
                                              GError        **error);
 


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