All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] config: simplify git_config_include()
@ 2014-08-30 16:07 René Scharfe
  0 siblings, 0 replies; only message in thread
From: René Scharfe @ 2014-08-30 16:07 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano

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>
---
 config.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/config.c b/config.c
index 058505c..c558a21 100644
--- a/config.c
+++ b/config.c
@@ -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;
 
 	/*
@@ -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;
 }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-30 16:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-30 16:07 [PATCH] config: simplify git_config_include() René Scharfe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.