From 8c2be75fe117f5079087a6dfb07c573cc6716143 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sat, 14 May 2011 15:19:21 -0500 Subject: add, merge, diff: do not use strcasecmp to compare config variable names The config machinery already makes section and variable names lowercase when parsing them, so using strcasecmp for comparison just feels wasteful. No noticeable change intended. Noticed-by: Jay Soffian Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin/add.c | 4 ++-- merge-recursive.c | 6 +++--- xdiff-interface.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/builtin/add.c b/builtin/add.c index d39a6ab93..944e5a8cc 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -330,8 +330,8 @@ static struct option builtin_add_options[] = { static int add_config(const char *var, const char *value, void *cb) { - if (!strcasecmp(var, "add.ignoreerrors") || - !strcasecmp(var, "add.ignore-errors")) { + if (!strcmp(var, "add.ignoreerrors") || + !strcmp(var, "add.ignore-errors")) { ignore_add_errors = git_config_bool(var, value); return 0; } diff --git a/merge-recursive.c b/merge-recursive.c index af131508e..dba27643b 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1711,15 +1711,15 @@ int merge_recursive_generic(struct merge_options *o, static int merge_recursive_config(const char *var, const char *value, void *cb) { struct merge_options *o = cb; - if (!strcasecmp(var, "merge.verbosity")) { + if (!strcmp(var, "merge.verbosity")) { o->verbosity = git_config_int(var, value); return 0; } - if (!strcasecmp(var, "diff.renamelimit")) { + if (!strcmp(var, "diff.renamelimit")) { o->diff_rename_limit = git_config_int(var, value); return 0; } - if (!strcasecmp(var, "merge.renamelimit")) { + if (!strcmp(var, "merge.renamelimit")) { o->merge_rename_limit = git_config_int(var, value); return 0; } diff --git a/xdiff-interface.c b/xdiff-interface.c index 164581f87..0e2c16922 100644 --- a/xdiff-interface.c +++ b/xdiff-interface.c @@ -347,7 +347,7 @@ int git_xmerge_style = -1; int git_xmerge_config(const char *var, const char *value, void *cb) { - if (!strcasecmp(var, "merge.conflictstyle")) { + if (!strcmp(var, "merge.conflictstyle")) { if (!value) die("'%s' is not a boolean", var); if (!strcmp(value, "diff3")) -- cgit v1.2.1