summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'config.h')
-rw-r--r--config.h46
1 files changed, 13 insertions, 33 deletions
diff --git a/config.h b/config.h
index f119de0130..ab0106d287 100644
--- a/config.h
+++ b/config.h
@@ -89,6 +89,15 @@ struct config_options {
unsigned int ignore_worktree : 1;
unsigned int ignore_cmdline : 1;
unsigned int system_gently : 1;
+
+ /*
+ * For internal use. Include all includeif.hasremoteurl paths without
+ * checking if the repo has that remote URL, and when doing so, verify
+ * that files included in this way do not configure any remote URLs
+ * themselves.
+ */
+ unsigned int unconditional_remote_url : 1;
+
const char *commondir;
const char *git_dir;
config_parser_event_fn_t event_fn;
@@ -126,6 +135,8 @@ int git_default_config(const char *, const char *, void *);
/**
* Read a specific file in git-config format.
* This function takes the same callback and data parameters as `git_config`.
+ *
+ * Unlike git_config(), this function does not respect includes.
*/
int git_config_from_file(config_fn_t fn, const char *, void *);
@@ -158,6 +169,8 @@ void read_very_early_config(config_fn_t cb, void *data);
* will first feed the user-wide one to the callback, and then the
* repo-specific one; by overwriting, the higher-priority repo-specific
* value is left at the end).
+ *
+ * Unlike git_config_from_file(), this function respects includes.
*/
void git_config(config_fn_t fn, void *);
@@ -338,39 +351,6 @@ const char *current_config_origin_type(void);
const char *current_config_name(void);
int current_config_line(void);
-/**
- * Include Directives
- * ------------------
- *
- * By default, the config parser does not respect include directives.
- * However, a caller can use the special `git_config_include` wrapper
- * callback to support them. To do so, you simply wrap your "real" callback
- * function and data pointer in a `struct config_include_data`, and pass
- * the wrapper to the regular config-reading functions. For example:
- *
- * -------------------------------------------
- * int read_file_with_include(const char *file, config_fn_t fn, void *data)
- * {
- * struct config_include_data inc = CONFIG_INCLUDE_INIT;
- * inc.fn = fn;
- * inc.data = data;
- * return git_config_from_file(git_config_include, file, &inc);
- * }
- * -------------------------------------------
- *
- * `git_config` respects includes automatically. The lower-level
- * `git_config_from_file` does not.
- *
- */
-struct config_include_data {
- int depth;
- config_fn_t fn;
- void *data;
- const struct config_options *opts;
-};
-#define CONFIG_INCLUDE_INIT { 0 }
-int git_config_include(const char *name, const char *value, void *data);
-
/*
* Match and parse a config key of the form:
*