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

Re: [PATCHv2 2/5] unpack-trees: remove unneeded continue

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 10, 2017, 19:55 UTC
Message-ID
<xmqqinpmsna7.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170109194621.17013-3-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 7 quoted lines
> The continue is the last statement in the loop, so not needed.
> This situation arose in 700e66d66 (2010-07-30, unpack-trees: let
> read-tree -u remove index entries outside sparse area) when statements
> after the continue were removed.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
Thanks for digging the history to find the culprit.  

This is an unrelated tangent, but I do not think of a way other than "log -L" to find it; conceptually, "blame" ought to be usable for it, but it is not useful for finding deleted lines.

Show 15 quoted lines
>  unpack-trees.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/unpack-trees.c b/unpack-trees.c
> index 8e6768f283..d443decb23 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -253,7 +253,6 @@ static int check_updates(struct unpack_trees_options *o)
>  			display_progress(progress, ++cnt);
>  			if (o->update && !o->dry_run)
>  				unlink_entry(ce);
> -			continue;
>  		}
>  	}
>  	remove_marked_cache_entries(index);
Previous: Stefan Beller
Message 10 of 10 in “[PATCHv2 0/5] refactor unpack-trees”
  1. Stefan BellerJan 9, 2017
  2. 5/5 unpack-trees: factor working tree update out of check_updatesStefan Beller, Jan 9, 2017
  3. 4/5 unpack-trees: factor file removal out of check_updatesStefan Beller, Jan 9, 2017
  4. Junio C HamanoJan 10, 2017
  5. Stefan BellerJan 10, 2017
  6. Junio C HamanoJan 10, 2017
  7. 3/5 unpack-trees: factor progress setup out of check_updatesStefan Beller, Jan 9, 2017
  8. 1/5 unpack-trees: move checkout state into check_updatesStefan Beller, Jan 9, 2017
  9. 2/5 unpack-trees: remove unneeded continueStefan Beller, Jan 9, 2017
  10. Junio C HamanoJan 10, 2017

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.