[libgit2-glib] remote: remote_add_fetch_spec is now in the repository



commit 4230851bce131d9df871877c0b46c467043bf8df
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Jul 6 20:43:36 2015 +0200

    remote: remote_add_fetch_spec is now in the repository
    
    The method is now part of the repository changing the configuration
    of the remote and not affecting the loaded remotes.

 libgit2-glib/ggit-remote.c     |   27 ---------------------------
 libgit2-glib/ggit-remote.h     |    4 ----
 libgit2-glib/ggit-repository.c |   33 +++++++++++++++++++++++++++++++++
 libgit2-glib/ggit-repository.h |    7 ++++++-
 4 files changed, 39 insertions(+), 32 deletions(-)
---
diff --git a/libgit2-glib/ggit-remote.c b/libgit2-glib/ggit-remote.c
index 4038d77..79ac579 100644
--- a/libgit2-glib/ggit-remote.c
+++ b/libgit2-glib/ggit-remote.c
@@ -435,33 +435,6 @@ ggit_remote_update_tips (GgitRemote     *remote,
 }
 
 /**
- * ggit_remote_add_fetch_spec:
- * @remote: a #GgitRemote.
- * @fetch_spec: the fetch refspec.
- * @error: a #GError for error reporting, or %NULL.
- *
- * Sets @remote's fetch spec to @fetch_spec.
- */
-void
-ggit_remote_add_fetch_spec (GgitRemote   *remote,
-                            const gchar  *fetch_spec,
-                            GError      **error)
-{
-       gint ret;
-
-       g_return_if_fail (GGIT_IS_REMOTE (remote));
-       g_return_if_fail (fetch_spec != NULL && fetch_spec[0] != '\0');
-       g_return_if_fail (error == NULL || *error == NULL);
-
-       ret = git_remote_add_fetch (_ggit_native_get (remote), fetch_spec);
-
-       if (ret != GIT_OK)
-       {
-               _ggit_error_set (error, ret);
-       }
-}
-
-/**
  * ggit_remote_get_fetch_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 c04b24e..fabb987 100644
--- a/libgit2-glib/ggit-remote.h
+++ b/libgit2-glib/ggit-remote.h
@@ -105,10 +105,6 @@ gboolean           ggit_remote_update_tips              (GgitRemote       *remot
                                                          const gchar      *message,
                                                          GError          **error);
 
-void               ggit_remote_add_fetch_spec           (GgitRemote       *remote,
-                                                         const gchar      *fetch_spec,
-                                                         GError          **error);
-
 gchar            **ggit_remote_get_fetch_specs          (GgitRemote       *remote,
                                                          GError          **error);
 
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index 943ea31..07f48cb 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -1907,6 +1907,39 @@ ggit_repository_add_remote_push (GgitRepository  *repository,
 }
 
 /**
+ * ggit_repository_add_remote_fetch:
+ * @repository: a #GgitRepository.
+ * @remote: a #GgitRemote.
+ * @refspec: the fetch refspec.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Adds a fetch refspec to the @remote's configuration.
+ * Adds @refspec to the fetch list in the configuration. No
+ * loaded remote instances will be affected.
+ */
+void
+ggit_repository_add_remote_fetch (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_fetch (_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 82e9f57..533f41e 100644
--- a/libgit2-glib/ggit-repository.h
+++ b/libgit2-glib/ggit-repository.h
@@ -247,7 +247,12 @@ gchar             **ggit_repository_list_remotes      (GgitRepository        *re
 
 void                ggit_repository_add_remote_push   (GgitRepository        *repository,
                                                        GgitRemote            *remote,
-                                                       const gchar           *push_spec,
+                                                       const gchar           *refspec,
+                                                       GError               **error);
+
+void                ggit_repository_add_remote_fetch  (GgitRepository        *repository,
+                                                       GgitRemote            *remote,
+                                                       const gchar           *refspec,
                                                        GError               **error);
 
 GgitRef            *ggit_repository_get_head          (GgitRepository        *repository,


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