summaryrefslogtreecommitdiff
path: root/builtin/apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-11 17:33:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-09-11 17:33:26 (GMT)
commit554913daf43f744f7d6bd8bd2cd008d96d19cbd9 (patch)
treee83dcd2916bf78c7433392afa81461fd4b0fef53 /builtin/apply.c
parent7f346e9d73e75871d525664f36b7a5166b4feaf3 (diff)
parentb35b10d463fbc274a2edd006f6f5ab46e66a4722 (diff)
downloadgit-554913daf43f744f7d6bd8bd2cd008d96d19cbd9.zip
git-554913daf43f744f7d6bd8bd2cd008d96d19cbd9.tar.gz
git-554913daf43f744f7d6bd8bd2cd008d96d19cbd9.tar.bz2
Merge branch 'ta/config-set-2'
Update git_config() users with callback functions for a very narrow scope with calls to config-set API that lets us query a single variable. * ta/config-set-2: builtin/apply.c: replace `git_config()` with `git_config_get_string_const()` merge-recursive.c: replace `git_config()` with `git_config_get_int()` ll-merge.c: refactor `read_merge_config()` to use `git_config_string()` fast-import.c: replace `git_config()` with `git_config_get_*()` family branch.c: replace `git_config()` with `git_config_get_string() alias.c: replace `git_config()` with `git_config_get_string()` imap-send.c: replace `git_config()` with `git_config_get_*()` family pager.c: replace `git_config()` with `git_config_get_value()` builtin/gc.c: replace `git_config()` with `git_config_get_*()` family rerere.c: replace `git_config()` with `git_config_get_*()` family fetchpack.c: replace `git_config()` with `git_config_get_*()` family archive.c: replace `git_config()` with `git_config_get_bool()` family read-cache.c: replace `git_config()` with `git_config_get_*()` family http-backend.c: replace `git_config()` with `git_config_get_bool()` family daemon.c: replace `git_config()` with `git_config_get_bool()` family
Diffstat (limited to 'builtin/apply.c')
-rw-r--r--builtin/apply.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/builtin/apply.c b/builtin/apply.c
index 6b7c764..f204cca 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -4274,13 +4274,11 @@ static int apply_patch(int fd, const char *filename, int options)
return 0;
}
-static int git_apply_config(const char *var, const char *value, void *cb)
+static void git_apply_config(void)
{
- if (!strcmp(var, "apply.whitespace"))
- return git_config_string(&apply_default_whitespace, var, value);
- else if (!strcmp(var, "apply.ignorewhitespace"))
- return git_config_string(&apply_default_ignorewhitespace, var, value);
- return git_default_config(var, value, cb);
+ git_config_get_string_const("apply.whitespace", &apply_default_whitespace);
+ git_config_get_string_const("apply.ignorewhitespace", &apply_default_ignorewhitespace);
+ git_config(git_default_config, NULL);
}
static int option_parse_exclude(const struct option *opt,
@@ -4428,7 +4426,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix_)
prefix = prefix_;
prefix_length = prefix ? strlen(prefix) : 0;
- git_config(git_apply_config, NULL);
+ git_apply_config();
if (apply_default_whitespace)
parse_whitespace_option(apply_default_whitespace);
if (apply_default_ignorewhitespace)