Re: [PATCH] rm: do not set a variable twice without intermediate reading.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stefan Beller <stefanbeller@xxxxxxxxxxxxxx> writes:

> Just the next line assigns a non-null value to seen.
>
> Signed-off-by: Stefan Beller <stefanbeller@xxxxxxxxxxxxxx>
> ---
>  builtin/rm.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/builtin/rm.c b/builtin/rm.c
> index 5b63d3f..df85f98 100644
> --- a/builtin/rm.c
> +++ b/builtin/rm.c
> @@ -316,7 +316,6 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
>  	parse_pathspec(&pathspec, 0, PATHSPEC_PREFER_CWD, prefix, argv);
>  	refresh_index(&the_index, REFRESH_QUIET, &pathspec, NULL, NULL);
>  
> -	seen = NULL;
>  	seen = xcalloc(pathspec.nr, 1);
>  
>  	for (i = 0; i < active_nr; i++) {

Interesting. This is ancient and dates back to 7612a1ef (git-rm:
honor -n flag., 2006-06-08).

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]