add tests for `git_config_get_string_const()`
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index 89a0d515155c4a1408832fa925b064f877bbd856..2693a3736a7dbb058938ae4e2732e7cc0cf2336c 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -8,6 +8,7 @@
 #include "gettext.h"
 #include "convert.h"
 #include "trace.h"
+#include "string-list.h"
 
 #include SHA1_HEADER
 #ifndef git_SHA_CTX
@@ -1351,9 +1352,32 @@ extern int parse_config_key(const char *var,
                            const char **subsection, int *subsection_len,
                            const char **key);
 
+struct config_set_element {
+       struct hashmap_entry ent;
+       char *key;
+       struct string_list value_list;
+};
+
+struct configset_list_item {
+       struct config_set_element *e;
+       int value_index;
+};
+
+/*
+ * the contents of the list are ordered according to their
+ * position in the config files and order of parsing the files.
+ * (i.e. key-value pair at the last position of .git/config will
+ * be at the last item of the list)
+ */
+struct configset_list {
+       struct configset_list_item *items;
+       unsigned int nr, alloc;
+};
+
 struct config_set {
        struct hashmap config_hash;
        int hash_initialized;
+       struct configset_list list;
 };
 
 extern void git_configset_init(struct config_set *cs);