summaryrefslogtreecommitdiff
path: root/builtin/log.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-10-14 10:50:07 -0700
committerJunio C Hamano <gitster@pobox.com>2014-10-14 10:50:07 -0700
commit145c590df8131abe510adde677eb3121cf52d31e (patch)
tree1bec212671aca326a5f966df97e159bc25ccdb79 /builtin/log.c
parent63434da0b4966894b5b812965cb3ada3d4101d6c (diff)
parente3f1da982e4f14e7146964cb25a5011a3f41e84a (diff)
downloadgit-145c590df8131abe510adde677eb3121cf52d31e.tar.gz
Merge branch 'rs/more-uses-of-skip-prefix'
* rs/more-uses-of-skip-prefix: use skip_prefix() to avoid more magic numbers
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 2fb34c7de9..1202eba8b6 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -368,6 +368,8 @@ static int cmd_log_walk(struct rev_info *rev)
static int git_log_config(const char *var, const char *value, void *cb)
{
+ const char *slot_name;
+
if (!strcmp(var, "format.pretty"))
return git_config_string(&fmt_pretty, var, value);
if (!strcmp(var, "format.subjectprefix"))
@@ -388,8 +390,8 @@ static int git_log_config(const char *var, const char *value, void *cb)
default_show_root = git_config_bool(var, value);
return 0;
}
- if (starts_with(var, "color.decorate."))
- return parse_decorate_color_config(var, 15, value);
+ if (skip_prefix(var, "color.decorate.", &slot_name))
+ return parse_decorate_color_config(var, slot_name - var, value);
if (!strcmp(var, "log.mailmap")) {
use_mailmap_config = git_config_bool(var, value);
return 0;