[libgit2-glib] Bind ggit_config_refresh
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Bind ggit_config_refresh
- Date: Sun, 4 Nov 2012 15:12:35 +0000 (UTC)
commit 204c21ee3a40e82efdd970fb33855245c23da69b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Thu Nov 1 11:03:51 2012 +0100
Bind ggit_config_refresh
libgit2-glib/ggit-config.c | 29 +++++++++++++++++++++++++++++
libgit2-glib/ggit-config.h | 3 +++
2 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-config.c b/libgit2-glib/ggit-config.c
index 602d221..c98b108 100644
--- a/libgit2-glib/ggit-config.c
+++ b/libgit2-glib/ggit-config.c
@@ -265,6 +265,35 @@ ggit_config_add_file (GgitConfig *config,
}
/**
+ * ggit_config_refresh:
+ * @config: a #GgitConfig.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Reloads changed config files.
+ *
+ * A config file may be changed on disk out from under the in-memory
+ * config object. This function causes us to look for files that have
+ * been modified since we last loaded them and refresh the config with
+ * the latest information.
+ */
+void
+ggit_config_refresh (GgitConfig *config,
+ GError **error)
+{
+ gint ret;
+
+ g_return_if_fail (GGIT_IS_CONFIG (config));
+ g_return_if_fail (error == NULL || *error == NULL);
+
+ ret = git_config_refresh (_ggit_native_get (config));
+
+ if (ret != GIT_OK)
+ {
+ _ggit_error_set (error, ret);
+ }
+}
+
+/**
* ggit_config_get_int32:
* @config: a #GgitConfig.
* @name: the name of the configuration value.
diff --git a/libgit2-glib/ggit-config.h b/libgit2-glib/ggit-config.h
index e09aa29..92d9c89 100644
--- a/libgit2-glib/ggit-config.h
+++ b/libgit2-glib/ggit-config.h
@@ -76,6 +76,9 @@ void ggit_config_add_file (GgitConfig *config,
gboolean force,
GError **error);
+void ggit_config_refresh (GgitConfig *config,
+ GError **error);
+
gint32 ggit_config_get_int32 (GgitConfig *config,
const gchar *name,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]