From 26cf48fcf8cf0ecd2b098a41c8873a75e0186577 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 9 Feb 2018 11:35:16 +0000 Subject: config_file: move include depth into config entry In order to reject writes to included configuration entries, we need to keep track of whether an entry was included via another configuration file or not. This information is being stored in the `cvar` structure, which is a rather weird location, as it is only used to create a list structure of config entries. Move the include depth into the structure `git_config_entry` instead. While this fixes the layering issue, it enables users of libgit2 to access the depth, too. --- include/git2/config.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/git2/config.h b/include/git2/config.h index d9da65b84..7bcca7da2 100644 --- a/include/git2/config.h +++ b/include/git2/config.h @@ -64,6 +64,7 @@ typedef enum { typedef struct git_config_entry { const char *name; /**< Name of the entry (normalised) */ const char *value; /**< String value of the entry */ + unsigned int include_depth; /**< Depth of includes where this variable was found */ git_config_level_t level; /**< Which config file this was found in */ void (*free)(struct git_config_entry *entry); /**< Free function for this entry */ void *payload; /**< Opaque value for the free function. Do not read or write */ -- cgit v1.2.1