Skip to contentSkip to conversation

config: remove useless assignment

PATCH In review René Scharfe 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 config: remove useless assignment

v1.7.9-8-g270a344 (config: stop using config_exclusive_filename) replaced config_exclusive_filename with given_config_file. In one case this resulted in a self-assignment, which is reported by clang as a warning. Remove the useless code.

---
 builtin/config.c |    2 --
 1 file changed, 2 deletions(-)
builtin/config.c +0 -2
index d41a9bf..33c8820 100644
@@ -397,8 +397,6 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 				xstrdup(prefix_filename(prefix,
 							strlen(prefix),
 							given_config_file));
-		else
-			given_config_file = given_config_file;
 	}
 
 	if (respect_includes == -1)
Signature · 1 line
1.7.9.2
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · René Scharfe

v1.7.9-8-g270a344 (config: stop using config_exclusive_filename) replaced config_exclusive_filename with given_config_file. In one case this resulted in a self-assignment, which is reported by clang as a warning. Remove the useless code.

---
 builtin/config.c |    2 --
 1 file changed, 2 deletions(-)
builtin/config.c +0 -0
index d41a9bf..33c8820 100644

builtin/config.c int cmd_config(int argc, const char **argv, const char *prefix) · line 400

Quoted 6 lines
builtin/config.c +0 -2
@@ -397,8 +397,6 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 				xstrdup(prefix_filename(prefix,
 							strlen(prefix),
 							given_config_file));
-		else
-			given_config_file = given_config_file;
 	}

Thanks. I remember refactoring that part of the conditional several times while figuring out the right ordering of my refactoring patches, but obviously I missed removing the stale code on the final pass-through.

-Peff