git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 23, 2013, 18:32 UTC
Message-ID
<7v4nbl86us.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1374571162-22881-1-git-send-email-stefanbeller@googlemail.com>
Stefan Beller <stefanbeller@googlemail.com> writes:
Show 19 quoted lines
> Just the next line assigns a non-null value to seen.
>
> Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
> ---
>  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).

Previous: Stefan BellerNext: Stefan Beller
Message 2 of 4 in “rm: do not set a variable twice without intermediate reading.”
  1. rm: do not set a variable twice without intermediate reading.Stefan Beller, Jul 23, 2013
  2. Junio C HamanoJul 23, 2013
  3. Stefan BellerJul 23, 2013
  4. Junio C HamanoJul 23, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.