[libgit2-glib] Added a wrapper function for git_remote_prune.



commit caa0b64d09a33ba9001c4e14e047b6e6cdfa0819
Author: Armandas JaruĊĦauskas <jarusauskas gmail com>
Date:   Sat Jun 27 15:41:41 2020 +0900

    Added a wrapper function for git_remote_prune.

 libgit2-glib/ggit-remote.c | 27 +++++++++++++++++++++++++++
 libgit2-glib/ggit-remote.h |  4 ++++
 2 files changed, 31 insertions(+)
---
diff --git a/libgit2-glib/ggit-remote.c b/libgit2-glib/ggit-remote.c
index b2e539f..7bc18da 100644
--- a/libgit2-glib/ggit-remote.c
+++ b/libgit2-glib/ggit-remote.c
@@ -625,4 +625,31 @@ ggit_remote_upload (GgitRemote              *remote,
        return TRUE;
 }
 
+/**
+ * ggit_remote_prune:
+ * @remote: a #GgitRemote.
+ * @callbacks: the callbacks to use for this connection.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Prune tracking refs that are no longer present on remote.
+ */
+void
+ggit_remote_prune (GgitRemote           *remote,
+                   GgitRemoteCallbacks  *callbacks,
+                   GError              **error)
+{
+       gint ret;
+
+       g_return_if_fail (GGIT_IS_REMOTE (remote));
+       g_return_if_fail (error == NULL || *error == NULL);
+
+       ret = git_remote_prune (_ggit_native_get (remote),
+                               _ggit_remote_callbacks_get_native (callbacks));
+
+       if (ret != GIT_OK)
+       {
+               _ggit_error_set (error, ret);
+       }
+}
+
 /* ex:set ts=8 noet: */
diff --git a/libgit2-glib/ggit-remote.h b/libgit2-glib/ggit-remote.h
index 7d8fc62..91f6de9 100644
--- a/libgit2-glib/ggit-remote.h
+++ b/libgit2-glib/ggit-remote.h
@@ -115,6 +115,10 @@ gboolean           ggit_remote_upload                   (GgitRemote
                                                          GgitPushOptions         *push_options,
                                                          GError                 **error);
 
+void               ggit_remote_prune                    (GgitRemote           *remote,
+                                                         GgitRemoteCallbacks  *callbacks,
+                                                         GError              **error);
+
 G_END_DECLS
 
 #endif /* __GGIT_REMOTE_H__ */


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