Skip to content

Commit

Permalink
config: simplify git_config_include()
Browse files Browse the repository at this point in the history
Instead of using skip_prefix() to check the first part of the string
and then strcmp() to check the rest, simply use strcmp() to check the
whole string.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
René Scharfe authored and Junio C Hamano committed Sep 2, 2014
1 parent 96db324 commit 37007c3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ static int handle_path_include(const char *path, struct config_include_data *inc
int git_config_include(const char *var, const char *value, void *data)
{
struct config_include_data *inc = data;
const char *type;
int ret;

/*
Expand All @@ -138,10 +137,7 @@ int git_config_include(const char *var, const char *value, void *data)
if (ret < 0)
return ret;

if (!skip_prefix(var, "include.", &type))
return ret;

if (!strcmp(type, "path"))
if (!strcmp(var, "include.path"))
ret = handle_path_include(value, inc);
return ret;
}
Expand Down

0 comments on commit 37007c3

Please sign in to comment.