[libgit2-glib] Add new GgitConfigLevel enum



commit 3dd66d2854ff850b5c9f059beb4f995c3e106f3c
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Oct 29 18:48:57 2012 +0100

    Add new GgitConfigLevel enum

 libgit2-glib/ggit-types.c |    5 +++++
 libgit2-glib/ggit-types.h |   24 +++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/libgit2-glib/ggit-types.c b/libgit2-glib/ggit-types.c
index bd4a5e6..479e3b2 100644
--- a/libgit2-glib/ggit-types.c
+++ b/libgit2-glib/ggit-types.c
@@ -35,6 +35,11 @@
 ASSERT_ENUM (GGIT_BRANCH_LOCAL,  GIT_BRANCH_LOCAL);
 ASSERT_ENUM (GGIT_BRANCH_REMOTE, GIT_BRANCH_REMOTE);
 
+ASSERT_ENUM (GGIT_CONFIG_LEVEL_SYSTEM, GIT_CONFIG_LEVEL_SYSTEM);
+ASSERT_ENUM (GGIT_CONFIG_LEVEL_XDG, GIT_CONFIG_LEVEL_XDG);
+ASSERT_ENUM (GGIT_CONFIG_LEVEL_GLOBAL, GIT_CONFIG_LEVEL_GLOBAL);
+ASSERT_ENUM (GGIT_CONFIG_LEVEL_LOCAL, GIT_CONFIG_LEVEL_LOCAL);
+ASSERT_ENUM (GGIT_CONFIG_LEVEL_HIGHEST, GIT_CONFIG_HIGHEST_LEVEL);
 
 ASSERT_ENUM (GGIT_DELTA_UNMODIFIED, GIT_DELTA_UNMODIFIED);
 ASSERT_ENUM (GGIT_DELTA_ADDED,      GIT_DELTA_ADDED);
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index d6e6427..df46aab 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -252,12 +252,34 @@ typedef struct _GgitTreeEntry GgitTreeEntry;
  *
  * The type of a branch.
  */
-typedef enum {
+typedef enum
+{
 	GGIT_BRANCH_LOCAL  = 1,
 	GGIT_BRANCH_REMOTE = 2
 } GgitBranchType;
 
 /**
+ * GgitConfigLevel:
+ * @GGIT_CONFIG_LEVEL_SYSTEM: System-wide configuration file.
+ * @GGIT_CONFIG_LEVEL_XDG: XDG compatible configuration file (.config/git/config).
+ * @GGIT_CONFIG_LEVEL_GLOBAL: User-specific configuration file, also called Global configuration file.
+ * @GGIT_CONFIG_LEVEL_LOCAL: Repository specific configuration file.
+ * @GGIT_CONFIG_LEVEL_HIGHEST: Represents the highest level of a config file.
+ *
+ * Priority level of a config file.
+ * These priority levels correspond to the natural escalation logic
+ * (from higher to lower) when searching for config entries in git.git.
+ */
+typedef enum
+{
+	GGIT_CONFIG_LEVEL_SYSTEM = 1,
+	GGIT_CONFIG_LEVEL_XDG = 2,
+	GGIT_CONFIG_LEVEL_GLOBAL = 3,
+	GGIT_CONFIG_LEVEL_LOCAL = 4,
+	GGIT_CONFIG_LEVEL_HIGHEST = -1
+} GgitConfigLevel;
+
+/**
  * GgitCreateFlags:
  * @GGIT_CREATE_NONE: attempt to create.
  * @GGIT_CREATE_FORCE: force creation.



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