[libgit2-glib] Rename remote_add_push_spec as repository_add_remote_push



commit 9efc25bac5c646e4298d1c03866d775e4fcc0734
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Jul 1 00:00:49 2015 +0200

    Rename remote_add_push_spec as repository_add_remote_push

 libgit2-glib/ggit-remote.c     |   27 ---------------------------
 libgit2-glib/ggit-remote.h     |    4 ----
 libgit2-glib/ggit-repository.c |   33 +++++++++++++++++++++++++++++++++
 libgit2-glib/ggit-repository.h |    5 +++++
 4 files changed, 38 insertions(+), 31 deletions(-)
---
diff --git a/libgit2-glib/ggit-remote.c b/libgit2-glib/ggit-remote.c
index be9d970..01d6538 100644
--- a/libgit2-glib/ggit-remote.c
+++ b/libgit2-glib/ggit-remote.c
@@ -752,33 +752,6 @@ ggit_remote_set_fetch_specs (GgitRemote           *remote,
 }
 
 /**
- * ggit_remote_add_push_spec:
- * @remote: a #GgitRemote.
- * @push_spec: the push refspec.
- * @error: a #GError for error reporting, or %NULL.
- *
- * Sets @remote's push spec to @fetch_spec.
- */
-void
-ggit_remote_add_push_spec (GgitRemote   *remote,
-                           const gchar  *push_spec,
-                           GError      **error)
-{
-       gint ret;
-
-       g_return_if_fail (GGIT_IS_REMOTE (remote));
-       g_return_if_fail (push_spec != NULL && push_spec[0] != '\0');
-       g_return_if_fail (error == NULL || *error == NULL);
-
-       ret = git_remote_add_push (_ggit_native_get (remote), push_spec);
-
-       if (ret != GIT_OK)
-       {
-               _ggit_error_set (error, ret);
-       }
-}
-
-/**
  * ggit_remote_get_push_specs:
  * @remote: a #GgitRemote.
  * @error: a #GError for error reporting, or %NULL.
diff --git a/libgit2-glib/ggit-remote.h b/libgit2-glib/ggit-remote.h
index 53d84c2..6d3ba0b 100644
--- a/libgit2-glib/ggit-remote.h
+++ b/libgit2-glib/ggit-remote.h
@@ -124,10 +124,6 @@ gboolean           ggit_remote_set_fetch_specs          (GgitRemote           *r
                                                          const gchar * const  *specs,
                                                          GError              **error);
 
-void               ggit_remote_add_push_spec            (GgitRemote       *remote,
-                                                         const gchar      *push_spec,
-                                                         GError          **error);
-
 gchar            **ggit_remote_get_push_specs           (GgitRemote       *remote,
                                                          GError          **error);
 
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index bc7094d..ca69ee6 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -1888,6 +1888,39 @@ ggit_repository_list_remotes (GgitRepository  *repository,
 }
 
 /**
+ * ggit_repository_add_remote_push:
+ * @repository: a #GgitRepository.
+ * @remote: a #GgitRemote.
+ * @refspec: the push refspec.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Adds a push refspec to @remote's configuration.
+ * Adds the given refspec to the push list in the configuration. No
+ * loaded remote instances will be affected.
+ */
+void
+ggit_repository_add_remote_push (GgitRepository  *repository,
+                                 GgitRemote      *remote,
+                                 const gchar     *refspec,
+                                 GError         **error)
+{
+       gint ret;
+
+       g_return_if_fail (GGIT_IS_REMOTE (remote));
+       g_return_if_fail (refspec != NULL && refspec[0] != '\0');
+       g_return_if_fail (error == NULL || *error == NULL);
+
+       ret = git_remote_add_push (_ggit_native_get (repository),
+                                  _ggit_native_get (remote),
+                                  refspec);
+
+       if (ret != GIT_OK)
+       {
+               _ggit_error_set (error, ret);
+       }
+}
+
+/**
  * ggit_repository_lookup_submodule:
  * @repository: a #GgitRepository.
  * @name: the name of the submodule.
diff --git a/libgit2-glib/ggit-repository.h b/libgit2-glib/ggit-repository.h
index fd9536b..3af8962 100644
--- a/libgit2-glib/ggit-repository.h
+++ b/libgit2-glib/ggit-repository.h
@@ -249,6 +249,11 @@ GgitRemote         *ggit_repository_create_remote     (GgitRepository        *re
 gchar             **ggit_repository_list_remotes      (GgitRepository        *repository,
                                                        GError               **error);
 
+void                ggit_repository_add_remote_push   (GgitRepository        *repository,
+                                                       GgitRemote            *remote,
+                                                       const gchar           *push_spec,
+                                                       GError               **error);
+
 GgitRef            *ggit_repository_get_head          (GgitRepository        *repository,
                                                        GError               **error);
 


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