Skip to content

Commit

Permalink
add, merge, diff: do not use strcasecmp to compare config variable names
Browse files Browse the repository at this point in the history
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 <jaysoffian@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed May 15, 2011
1 parent 375f8a0 commit 8c2be75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions builtin/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion xdiff-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 8c2be75

Please sign in to comment.