[libgit2-glib] ggit_submodule_set_update has been moved to repository.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] ggit_submodule_set_update has been moved to repository.
- Date: Mon, 13 Jul 2015 20:25:41 +0000 (UTC)
commit 293fb1808eeb0c892674fa49494bfaa39f86e9f7
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Jul 13 22:25:17 2015 +0200
ggit_submodule_set_update has been moved to repository.
The new name is ggit_repository_set_submodule_update
libgit2-glib/ggit-repository.c | 32 ++++++++++++++++++++++++++++++++
libgit2-glib/ggit-repository.h | 5 +++++
libgit2-glib/ggit-submodule.c | 24 ------------------------
libgit2-glib/ggit-submodule.h | 3 ---
4 files changed, 37 insertions(+), 27 deletions(-)
---
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index ddb9b9f..5801bfd 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -2081,6 +2081,38 @@ ggit_repository_set_submodule_ignore (GgitRepository *repository,
}
/**
+ * ggit_repository_set_submodule_update:
+ * @repository: a #GgitRepository.
+ * @name: the name of the submodule.
+ * @update: a #GgitSubmoduleUpdate.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Sets the update rule for the submodule in the configuration.
+ * This setting won't affect any existing instances.
+ */
+void
+ggit_repository_set_submodule_update (GgitRepository *repository,
+ const gchar *name,
+ GgitSubmoduleUpdate update,
+ GError **error)
+{
+ gint ret;
+
+ g_return_if_fail (GGIT_IS_REPOSITORY (repository));
+ g_return_if_fail (name != NULL);
+ g_return_if_fail (error == NULL || *error == NULL);
+
+ ret = git_submodule_set_update (_ggit_native_get (repository),
+ name,
+ (git_submodule_update_t)update);
+
+ if (ret != GIT_OK)
+ {
+ _ggit_error_set (error, ret);
+ }
+}
+
+/**
* ggit_repository_set_submodule_url:
* @repository: a #GgitRepository.
* @name: the name of the submodule to configure.
diff --git a/libgit2-glib/ggit-repository.h b/libgit2-glib/ggit-repository.h
index 17a45be..df25554 100644
--- a/libgit2-glib/ggit-repository.h
+++ b/libgit2-glib/ggit-repository.h
@@ -315,6 +315,11 @@ void ggit_repository_set_submodule_ignore (GgitRepository *
GgitSubmoduleIgnore ignore,
GError **error);
+void ggit_repository_set_submodule_update (GgitRepository *repository,
+ const gchar *name,
+ GgitSubmoduleUpdate update,
+ GError **error);
+
void ggit_repository_set_submodule_url (GgitRepository *repository,
const gchar *name,
const gchar *url,
diff --git a/libgit2-glib/ggit-submodule.c b/libgit2-glib/ggit-submodule.c
index 8defb0c..0323e3f 100644
--- a/libgit2-glib/ggit-submodule.c
+++ b/libgit2-glib/ggit-submodule.c
@@ -290,30 +290,6 @@ ggit_submodule_get_update (GgitSubmodule *submodule)
}
/**
- * ggit_submodule_set_update:
- * @submodule: a #GgitSubmodule.
- * @update: a #GgitSubmoduleUpdate.
- *
- * Sets the update rule in memory for the submodule. You should call
- * ggit_submodule_save() if you want to persist the new update rule.
- *
- * Calling this again with GGIT_SUBMODULE_UPDATE_DEFAULT or calling
- * ggit_submodule_reload() will revert the rule to the value that was in the
- * original config.
- *
- * Returns: the old #GgitSubmoduleUpdate.
- */
-GgitSubmoduleUpdate
-ggit_submodule_set_update (GgitSubmodule *submodule,
- GgitSubmoduleUpdate update)
-{
- g_return_val_if_fail (submodule != NULL, 0);
-
- return (GgitSubmoduleUpdate)git_submodule_set_update (submodule->submodule,
- (git_submodule_update_t)update);
-}
-
-/**
* ggit_submodule_get_fetch_recurse:
* @submodule: a #GgitSubmodule.
*
diff --git a/libgit2-glib/ggit-submodule.h b/libgit2-glib/ggit-submodule.h
index d3667a1..eff7764 100644
--- a/libgit2-glib/ggit-submodule.h
+++ b/libgit2-glib/ggit-submodule.h
@@ -59,9 +59,6 @@ GgitSubmoduleIgnore ggit_submodule_get_ignore (GgitSubmodule
GgitSubmoduleUpdate ggit_submodule_get_update (GgitSubmodule *submodule);
-GgitSubmoduleUpdate ggit_submodule_set_update (GgitSubmodule *submodule,
- GgitSubmoduleUpdate update);
-
gboolean ggit_submodule_get_fetch_recurse (GgitSubmodule *submodule);
void ggit_submodule_init (GgitSubmodule *submodule,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]