summaryrefslogtreecommitdiff
path: root/builtin/log.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2014-10-07 19:16:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-10-14 18:01:05 (GMT)
commit8852117a603c5ed5131233a80453db37c0958871 (patch)
tree62d269e6d9685336fe675ddba629006bcb774da7 /builtin/log.c
parent80b616d04b8f5a15b5d5587d67baf6e2e28c9f87 (diff)
downloadgit-8852117a603c5ed5131233a80453db37c0958871.zip
git-8852117a603c5ed5131233a80453db37c0958871.tar.gz
git-8852117a603c5ed5131233a80453db37c0958871.tar.bz2
pass config slots as pointers instead of offsets
Many config-parsing helpers, like parse_branch_color_slot, take the name of a config variable and an offset to the "slot" name (e.g., "color.branch.plain" is passed along with "13" to effectively pass "plain"). This is leftover from the time that these functions would die() on error, and would want the full variable name for error reporting. These days they do not use the full variable name at all. Passing a single pointer to the slot name is more natural, and lets us more easily adjust the callers to use skip_prefix to avoid manually writing offset numbers. This is effectively a continuation of 9e1a5eb, which did the same for parse_diff_color_slot. This patch covers all of the remaining similar constructs. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 4389722..4c5fc4b 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -389,7 +389,7 @@ static int git_log_config(const char *var, const char *value, void *cb)
return 0;
}
if (starts_with(var, "color.decorate."))
- return parse_decorate_color_config(var, 15, value);
+ return parse_decorate_color_config(var, var + 15, value);
if (!strcmp(var, "log.mailmap")) {
use_mailmap_config = git_config_bool(var, value);
return 0;