[libgit2-glib] Adapt to changes in libgit2 api



commit c06b85f9f49c38b81a50c3b9241169dbf569b20d
Author: Javier JardÃn <jjardon gnome org>
Date:   Fri Jan 4 15:56:13 2013 +0000

    Adapt to changes in libgit2 api

 docs/reference/libgit2-glib-1.0-sections.txt |    2 +-
 libgit2-glib/ggit-remote.c                   |    7 ++-----
 libgit2-glib/ggit-remote.h                   |    1 -
 libgit2-glib/ggit-repository.c               |   18 +++++++++---------
 libgit2-glib/ggit-repository.h               |    2 +-
 5 files changed, 13 insertions(+), 17 deletions(-)
---
diff --git a/docs/reference/libgit2-glib-1.0-sections.txt b/docs/reference/libgit2-glib-1.0-sections.txt
index 042ff8f..f4c40ad 100644
--- a/docs/reference/libgit2-glib-1.0-sections.txt
+++ b/docs/reference/libgit2-glib-1.0-sections.txt
@@ -462,7 +462,7 @@ ggit_repository_delete_branch
 ggit_repository_move_branch
 ggit_repository_branches_foreach
 ggit_repository_get_remote
-ggit_repository_add_remote
+ggit_repository_create_remote
 ggit_repository_list_remotes
 ggit_repository_get_head
 ggit_repository_discover
diff --git a/libgit2-glib/ggit-remote.c b/libgit2-glib/ggit-remote.c
index 453da7f..de5c4ff 100644
--- a/libgit2-glib/ggit-remote.c
+++ b/libgit2-glib/ggit-remote.c
@@ -50,7 +50,6 @@ _ggit_remote_wrap (const git_remote *remote)
 /**
  * ggit_remote_new:
  * @repository: a #GgitRepository.
- * @name: the remote's name.
  * @url: the remote repository's URL.
  * @fetch_spec: the fetch refspec to use for this remote.
  * @error: a #GError for error reporting, or %NULL.
@@ -62,7 +61,6 @@ _ggit_remote_wrap (const git_remote *remote)
  */
 GgitRemote *
 ggit_remote_new (GgitRepository   *repository,
-                 const gchar      *name,
                  const gchar      *url,
                  const gchar      *fetch_spec,
                  GError          **error)
@@ -71,12 +69,11 @@ ggit_remote_new (GgitRepository   *repository,
 	git_remote *remote;
 
 	g_return_val_if_fail (GGIT_IS_REPOSITORY (repository), NULL);
-	g_return_val_if_fail (name != NULL, NULL);
 	g_return_val_if_fail (url != NULL, NULL);
 	g_return_val_if_fail (fetch_spec != NULL, NULL);
 
-	ret = git_remote_new (&remote, _ggit_native_get (repository),
-	                      name, url, fetch_spec);
+	ret = git_remote_create_inmemory (&remote, _ggit_native_get (repository),
+	                                  url, fetch_spec);
 
 	if (ret != GIT_OK)
 	{
diff --git a/libgit2-glib/ggit-remote.h b/libgit2-glib/ggit-remote.h
index 69cd547..3539dd7 100644
--- a/libgit2-glib/ggit-remote.h
+++ b/libgit2-glib/ggit-remote.h
@@ -36,7 +36,6 @@ GType              ggit_remote_get_type                 (void) G_GNUC_CONST;
 GgitRemote       *_ggit_remote_wrap                     (const git_remote *remote);
 
 GgitRemote        *ggit_remote_new                      (GgitRepository   *repository,
-                                                         const gchar      *name,
                                                          const gchar      *url,
                                                          const gchar      *fetch_spec,
                                                          GError          **error);
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index 6dce7ba..74647eb 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -1424,7 +1424,7 @@ ggit_repository_get_remote (GgitRepository  *repository,
 }
 
 /**
- * ggit_repository_add_remote:
+ * ggit_repository_create_remote:
  * @repository: a #GgitRepository.
  * @name: the name of the new remote.
  * @url: the url of the remote.
@@ -1435,10 +1435,10 @@ ggit_repository_get_remote (GgitRepository  *repository,
  * Returns: (transfer full) (allow-none): a new #GgitRemote or %NULL if there is an error.
  */
 GgitRemote *
-ggit_repository_add_remote (GgitRepository  *repository,
-                            const gchar     *name,
-                            const gchar     *url,
-                            GError         **error)
+ggit_repository_create_remote (GgitRepository  *repository,
+                               const gchar     *name,
+                               const gchar     *url,
+                               GError         **error)
 {
 	gint ret;
 	git_remote *remote;
@@ -1447,10 +1447,10 @@ ggit_repository_add_remote (GgitRepository  *repository,
 	g_return_val_if_fail (name != NULL, NULL);
 	g_return_val_if_fail (error == NULL || *error == NULL, NULL);
 
-	ret = git_remote_add (&remote,
-	                      _ggit_native_get (repository),
-	                      name,
-	                      url);
+	ret = git_remote_create (&remote,
+	                         _ggit_native_get (repository),
+	                         name,
+	                         url);
 
 	if (ret != GIT_OK)
 	{
diff --git a/libgit2-glib/ggit-repository.h b/libgit2-glib/ggit-repository.h
index ff2e996..bb9ed79 100644
--- a/libgit2-glib/ggit-repository.h
+++ b/libgit2-glib/ggit-repository.h
@@ -142,7 +142,7 @@ GgitRemote         *ggit_repository_get_remote        (GgitRepository        *re
                                                        const gchar           *name,
                                                        GError               **error);
 
-GgitRemote         *ggit_repository_add_remote        (GgitRepository        *repository,
+GgitRemote         *ggit_repository_create_remote     (GgitRepository        *repository,
                                                        const gchar           *name,
                                                        const gchar           *url,
                                                        GError               **error);



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