[libgit2-glib] Bind git_push_update_tips
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Bind git_push_update_tips
- Date: Fri, 26 Dec 2014 10:21:58 +0000 (UTC)
commit 88ece28db5146e0522f24a134fbc914301e2bb41
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Thu Dec 25 13:33:45 2014 +0100
Bind git_push_update_tips
libgit2-glib/ggit-push.c | 38 ++++++++++++++++++++++++++++++++++++++
libgit2-glib/ggit-push.h | 5 +++++
2 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-push.c b/libgit2-glib/ggit-push.c
index 2a7c247..edd7930 100644
--- a/libgit2-glib/ggit-push.c
+++ b/libgit2-glib/ggit-push.c
@@ -26,6 +26,7 @@
#include "ggit-enum-types.h"
#include "ggit-push-options.h"
#include "ggit-error.h"
+#include "ggit-signature.h"
#define GGIT_PUSH_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), GGIT_TYPE_PUSH, GgitPushPrivate))
@@ -378,6 +379,43 @@ ggit_push_finish (GgitPush *push,
}
/**
+ * ggit_push_update_tips:
+ * @push: a #GgitPush.
+ * @signature: a #GgitSignature with which to add to the reflog.
+ * @message: (allow-none): the message to add to the reflog, or %NULL for the
+ * "update by push" message.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Update remote tips to the new state after a push.
+ *
+ * Returns: %TRUE if successful, %FALSE otherwise.
+ */
+gboolean
+ggit_push_update_tips (GgitPush *push,
+ GgitSignature *signature,
+ const gchar *message,
+ GError **error)
+{
+ gint ret;
+
+ g_return_val_if_fail (GGIT_IS_PUSH (push), FALSE);
+ g_return_val_if_fail (GGIT_IS_SIGNATURE (signature), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ ret = git_push_update_tips (_ggit_native_get (push),
+ _ggit_native_get (signature),
+ message != NULL ? message : "update by push");
+
+ if (ret != GIT_OK)
+ {
+ _ggit_error_set (error, ret);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/**
* ggit_push_is_unpack_ok:
* @push: a #GgitPush.
*
diff --git a/libgit2-glib/ggit-push.h b/libgit2-glib/ggit-push.h
index b2f1257..9b11f65 100644
--- a/libgit2-glib/ggit-push.h
+++ b/libgit2-glib/ggit-push.h
@@ -80,6 +80,11 @@ void ggit_push_add_refspec (GgitPush *p
gboolean ggit_push_finish (GgitPush *push,
GError **error);
+gboolean ggit_push_update_tips (GgitPush *push,
+ GgitSignature *signature,
+ const gchar *message,
+ GError **error);
+
gboolean ggit_push_is_unpack_ok (GgitPush *push);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]