[libgit2-glib] ggit_submodule_set_url is now in repository
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] ggit_submodule_set_url is now in repository
- Date: Mon, 13 Jul 2015 19:35:14 +0000 (UTC)
commit a22daa1cffd2c60f2c31ba6d5621b86b0b4893ef
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Jul 13 21:33:44 2015 +0200
ggit_submodule_set_url is now in repository
This was renamed to ggit_repository_set_submodule_url
libgit2-glib/ggit-repository.c | 35 +++++++++++++++++++++++++++++++++++
libgit2-glib/ggit-repository.h | 5 +++++
libgit2-glib/ggit-submodule.c | 34 ----------------------------------
3 files changed, 40 insertions(+), 34 deletions(-)
---
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index fc687a0..7ead366 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -2049,6 +2049,41 @@ ggit_repository_submodule_foreach (GgitRepository *repository,
}
/**
+ * ggit_repository_set_submodule_url:
+ * @repository: a #GgitRepository.
+ * @name: the name of the submodule to configure.
+ * @url: URL that should be used for the submodule.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Sets the URL for the submodule in the configuration.
+ *
+ * After calling this, you may wish to call `git_submodule_sync()` to
+ * write the changes to the checked out submodule repository.
+ */
+void
+ggit_repository_set_submodule_url (GgitRepository *repository,
+ const gchar *name,
+ const gchar *url,
+ GError **error)
+{
+ gint ret;
+
+ g_return_if_fail (GGIT_IS_REPOSITORY (repository));
+ g_return_if_fail (name != NULL);
+ g_return_if_fail (url != NULL);
+ g_return_if_fail (error == NULL || *error == NULL);
+
+ ret = git_submodule_set_url (_ggit_native_get (repository),
+ name,
+ url);
+
+ if (ret != GIT_OK)
+ {
+ _ggit_error_set (error, ret);
+ }
+}
+
+/**
* ggit_repository_reset:
* @repository: a #GgitRepository.
* @target: the target #GgitObject which is a commit or a tag.
diff --git a/libgit2-glib/ggit-repository.h b/libgit2-glib/ggit-repository.h
index 3dd006c..c0f43b0 100644
--- a/libgit2-glib/ggit-repository.h
+++ b/libgit2-glib/ggit-repository.h
@@ -310,6 +310,11 @@ gboolean ggit_repository_submodule_foreach (GgitRepository
gpointer user_data,
GError **error);
+void ggit_repository_set_submodule_url (GgitRepository *repository,
+ const gchar *name,
+ const gchar *url,
+ GError **error);
+
void ggit_repository_reset (GgitRepository *repository,
GgitObject *target,
GgitResetType reset_type,
diff --git a/libgit2-glib/ggit-submodule.c b/libgit2-glib/ggit-submodule.c
index ab7cba0..151158d 100644
--- a/libgit2-glib/ggit-submodule.c
+++ b/libgit2-glib/ggit-submodule.c
@@ -185,40 +185,6 @@ ggit_submodule_get_url (GgitSubmodule *submodule)
}
/**
- * ggit_submodule_set_url:
- * @submodule: a #GgitSubmodule.
- * @url: URL that should be used for the submodule.
- * @error: a #GError for error reporting, or %NULL.
- *
- * Sets the URL for the submodule.
- *
- * This sets the URL in memory for the submodule. This will be used for
- * any following submodule actions while this submodule data is in memory.
- *
- * After calling this, you may wish to call ggit_submodule_save() to write
- * the changes back to the ".gitmodules" file and ggit_submodule_sync() to
- * write the changes to the checked out submodule repository.
- */
-void
-ggit_submodule_set_url (GgitSubmodule *submodule,
- const gchar *url,
- GError **error)
-{
- gint ret;
-
- g_return_if_fail (submodule != NULL);
- g_return_if_fail (error == NULL || *error == NULL);
-
- ret = git_submodule_set_url (submodule->submodule,
- url);
-
- if (ret != GIT_OK)
- {
- _ggit_error_set (error, ret);
- }
-}
-
-/**
* ggit_submodule_get_index_id:
* @submodule: a #GgitSubmodule.
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]