[libgit2-glib] Bind git_remote_update_tips



commit 85155d0f28a688a55900e30fa82f46b77ee001f7
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Tue Dec 23 17:35:01 2014 +0100

    Bind git_remote_update_tips

 libgit2-glib/ggit-remote.c |   38 ++++++++++++++++++++++++++++++++++++++
 libgit2-glib/ggit-remote.h |    5 +++++
 2 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-remote.c b/libgit2-glib/ggit-remote.c
index 6cc0a18..59d1cca 100644
--- a/libgit2-glib/ggit-remote.c
+++ b/libgit2-glib/ggit-remote.c
@@ -27,6 +27,7 @@
 #include "ggit-repository.h"
 #include "ggit-remote-callbacks.h"
 #include "ggit-utils.h"
+#include "ggit-signature.h"
 #include "ggit-transfer-progress.h"
 
 struct _GgitRemoteHead
@@ -599,6 +600,43 @@ ggit_remote_download (GgitRemote  *remote,
 }
 
 /**
+ * ggit_remote_update_tips:
+ * @remote: a #GgitRemote.
+ * @signature: a #GgitSignature with which to add to the reflog.
+ * @message: (allow-none): the message to add to the reflog, or %NULL for the
+ *                         "fetch" message.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Update tips to the new state.
+ *
+ * Returns: %TRUE if successful, %FALSE otherwise.
+ */
+gboolean
+ggit_remote_update_tips (GgitRemote     *remote,
+                         GgitSignature  *signature,
+                         const gchar    *message,
+                         GError        **error)
+{
+       gint ret;
+
+       g_return_val_if_fail (GGIT_IS_REMOTE (remote), FALSE);
+       g_return_val_if_fail (GGIT_IS_SIGNATURE (signature), FALSE);
+       g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+       ret = git_remote_update_tips (_ggit_native_get (remote),
+                                    _ggit_native_get (signature),
+                                     message != NULL ? message : "fetch");
+
+       if (ret != GIT_OK)
+       {
+               _ggit_error_set (error, ret);
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+/**
  * ggit_remote_add_fetch_spec:
  * @remote: a #GgitRemote.
  * @fetch_spec: the fetch refspec.
diff --git a/libgit2-glib/ggit-remote.h b/libgit2-glib/ggit-remote.h
index 398751a..ec58714 100644
--- a/libgit2-glib/ggit-remote.h
+++ b/libgit2-glib/ggit-remote.h
@@ -105,6 +105,11 @@ void               ggit_remote_disconnect               (GgitRemote       *remot
 gboolean           ggit_remote_download                 (GgitRemote       *remote,
                                                          GError          **error);
 
+gboolean           ggit_remote_update_tips              (GgitRemote       *remote,
+                                                         GgitSignature    *signature,
+                                                         const gchar      *message,
+                                                         GError          **error);
+
 void               ggit_remote_add_fetch_spec           (GgitRemote       *remote,
                                                          const gchar      *fetch_spec,
                                                          GError          **error);


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