All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] config: remove useless assignment
@ 2012-03-28 20:18 René Scharfe
  2012-03-28 20:22 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: René Scharfe @ 2012-03-28 20:18 UTC (permalink / raw)
  To: git discussion list; +Cc: Junio C Hamano, Jeff King

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.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 builtin/config.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/builtin/config.c b/builtin/config.c
index d41a9bf..33c8820 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -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)
-- 
1.7.9.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] config: remove useless assignment
  2012-03-28 20:18 [PATCH] config: remove useless assignment René Scharfe
@ 2012-03-28 20:22 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2012-03-28 20:22 UTC (permalink / raw)
  To: René Scharfe; +Cc: git discussion list, Junio C Hamano

On Wed, Mar 28, 2012 at 10:18:37PM +0200, René Scharfe wrote:

> 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.
> 
> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
> ---
>  builtin/config.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/builtin/config.c b/builtin/config.c
> index d41a9bf..33c8820 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -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.

Acked-by: Jeff King <peff@peff.net>

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-28 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-28 20:18 [PATCH] config: remove useless assignment René Scharfe
2012-03-28 20:22 ` Jeff King

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.