@@ -1687,7 +1687,7 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
if (opts->conflict_style) {
opts->merge = 1; /* implied */
- git_xmerge_config("merge.conflictstyle", opts->conflict_style, NULL);
+ git_xmerge_config("merge.conflictstyle", opts->conflict_style, NULL, NULL);
}
if (opts->force) {
opts->discard_changes = 1;
@@ -791,14 +791,14 @@ static int git_clone_config(const char *k, const char *v,
}
static int write_one_config(const char *key, const char *value,
- struct key_value_info *kvi UNUSED, void *data)
+ struct key_value_info *kvi, void *data)
{
/*
* give git_clone_config a chance to write config values back to the
* environment, since git_config_set_multivar_gently only deals with
* config-file writes
*/
- int apply_failed = git_clone_config(key, value, data);
+ int apply_failed = git_clone_config(key, value, kvi, data);
if (apply_failed)
return apply_failed;
@@ -290,7 +290,7 @@ static int wait_all(void)
static int grep_cmd_config(const char *var, const char *value,
struct key_value_info *kvi, void *cb)
{
- int st = grep_config(var, value, cb);
+ int st = grep_config(var, value, kvi, cb);
if (git_color_config(var, value, cb) < 0)
st = -1;
@@ -242,7 +242,8 @@ static int core_restrict_inherited_handles = -1;
static enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
static char *unset_environment_variables;
-int mingw_core_config(const char *var, const char *value, void *cb)
+int mingw_core_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb)
{
if (!strcmp(var, "core.hidedotfiles")) {
if (value && !strcasecmp(value, "dotgitonly"))
@@ -11,7 +11,9 @@ typedef _sigset_t sigset_t;
#undef _POSIX_THREAD_SAFE_FUNCTIONS
#endif
-int mingw_core_config(const char *var, const char *value, void *cb);
+struct key_value_info;
+int mingw_core_config(const char *var, const char *value,
+ struct key_value_info *, void *cb);
#define platform_core_config mingw_core_config
/*
@@ -532,6 +532,7 @@ void free_diffstat_info(struct diffstat_t *diffstat);
int parse_long_opt(const char *opt, const char **argv,
const char **optarg);
+struct key_value_info;
int git_diff_basic_config(const char *var, const char *value,
struct key_value_info *kvi, void *cb);
int git_diff_heuristic_config(const char *var, const char *value, void *cb);
@@ -233,6 +233,7 @@ void fsck_put_object_name(struct fsck_options *options,
const char *fsck_describe_object(struct fsck_options *options,
const struct object_id *oid);
+struct key_value_info;
/*
* git_config() callback for use by fsck-y tools that want to support
* fsck.<msg> fsck.skipList etc.
@@ -440,8 +440,10 @@ typedef uintmax_t timestamp_t;
#endif
#ifndef platform_core_config
+struct key_value_info;
static inline int noop_core_config(const char *var UNUSED,
const char *value UNUSED,
+ struct key_value_info *kvi UNUSED,
void *cb UNUSED)
{
return 0;
@@ -55,7 +55,7 @@ define_list_config_array_extra(color_grep_slots, {"match"});
* the grep_defaults template.
*/
int grep_config(const char *var, const char *value,
- struct key_value_info *kvi UNUSED, void *cb)
+ struct key_value_info *kvi, void *cb)
{
struct grep_opt *opt = cb;
const char *slot;
@@ -90,9 +90,9 @@ int grep_config(const char *var, const char *value,
if (!strcmp(var, "color.grep"))
opt->color = git_config_colorbool(var, value);
if (!strcmp(var, "color.grep.match")) {
- if (grep_config("color.grep.matchcontext", value, cb) < 0)
+ if (grep_config("color.grep.matchcontext", value, kvi, cb) < 0)
return -1;
- if (grep_config("color.grep.matchselected", value, cb) < 0)
+ if (grep_config("color.grep.matchselected", value, kvi, cb) < 0)
return -1;
} else if (skip_prefix(var, "color.grep.", &slot)) {
int i = LOOKUP_CONFIG(color_grep_slots, slot);
@@ -202,7 +202,9 @@ struct grep_opt {
.output = std_output, \
}
-int grep_config(const char *var, const char *value, void *);
+struct key_value_info;
+int grep_config(const char *var, const char *value, struct key_value_info *kvi,
+ void *);
void grep_init(struct grep_opt *, struct repository *repo);
void append_grep_pat(struct grep_opt *opt, const char *pat, size_t patlen, const char *origin, int no, enum grep_pat_token t);
@@ -361,7 +361,8 @@ static void process_curl_messages(void)
}
}
-static int http_options(const char *var, const char *value, void *cb)
+static int http_options(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp("http.version", var)) {
return git_config_string(&curl_http_version, var, value);
@@ -532,7 +533,7 @@ static int http_options(const char *var, const char *value, void *cb)
}
/* Fall back on the default ones */
- return git_default_config(var, value, cb);
+ return git_default_config(var, value, kvi, cb);
}
static int curl_empty_auth_enabled(void)
@@ -62,7 +62,8 @@ const char *fmt_name(enum want_ident);
int committer_ident_sufficiently_given(void);
int author_ident_sufficiently_given(void);
+struct key_value_info;
int git_ident_config(const char *, const char *,
- struct key_value_info *UNUSED, void *);
+ struct key_value_info *, void *);
#endif
@@ -675,7 +675,7 @@ out:
}
static int gitmodules_cb(const char *var, const char *value,
- struct key_value_info *kvi UNUSED, void *data)
+ struct key_value_info *kvi, void *data)
{
struct repository *repo = data;
struct parse_config_parameter parameter;
@@ -685,7 +685,7 @@ static int gitmodules_cb(const char *var, const char *value,
parameter.gitmodules_oid = null_oid();
parameter.overwrite = 1;
- return parse_config(var, value, ¶meter);
+ return parse_config(var, value, kvi, ¶meter);
}
void repo_read_gitmodules(struct repository *repo, int skip_if_read)
@@ -146,5 +146,5 @@ void tr2_cfg_set_fl(const char *file, int line, const char *key,
struct tr2_cfg_data data = { file, line };
if (tr2_cfg_load_patterns() > 0)
- tr2_cfg_cb(key, value, &data);
+ tr2_cfg_cb(key, value, NULL, &data);
}
@@ -552,7 +552,7 @@ static int cmp_matches(const struct urlmatch_item *a,
}
int urlmatch_config_entry(const char *var, const char *value,
- struct key_value_info *kvi UNUSED, void *cb)
+ struct key_value_info *kvi, void *cb)
{
struct string_list_item *item;
struct urlmatch_config *collect = cb;
@@ -566,7 +566,7 @@ int urlmatch_config_entry(const char *var, const char *value,
if (!skip_prefix(var, collect->section, &key) || *(key++) != '.') {
if (collect->cascade_fn)
- return collect->cascade_fn(var, value, cb);
+ return collect->cascade_fn(var, value, kvi, cb);
return 0; /* not interested */
}
dot = strrchr(key, '.');
@@ -610,7 +610,7 @@ int urlmatch_config_entry(const char *var, const char *value,
strbuf_addstr(&synthkey, collect->section);
strbuf_addch(&synthkey, '.');
strbuf_addstr(&synthkey, key);
- retval = collect->collect_fn(synthkey.buf, value, collect->cb);
+ retval = collect->collect_fn(synthkey.buf, value, kvi, collect->cb);
strbuf_release(&synthkey);
return retval;
@@ -50,6 +50,8 @@ int buffer_is_binary(const char *ptr, unsigned long size);
void xdiff_set_find_func(xdemitconf_t *xecfg, const char *line, int cflags);
void xdiff_clear_find_func(xdemitconf_t *xecfg);
+
+struct key_value_info;
int git_xmerge_config(const char *var, const char *value,
struct key_value_info *kvi, void *cb);
extern int git_xmerge_style;