Subject: Re: [PATCH v3 3/4] for-each-repo: work correctly in a worktree

From: Junio C Hamano <[email-masked]>
Date: Mon, 02 Mar 2026 13:32:28 -0800

Derrick Stolee <[email-masked]> writes:

> On 3/2/2026 1:06 PM, Jeff King wrote:
>> On Mon, Mar 02, 2026 at 03:36:44PM +0000, Derrick Stolee via GitGitGadget wrote:
>> 
>>> @@ -15,10 +16,11 @@ static const char * const for_each_repo_usage[] = {
>>>  
>>>  static int run_command_on_repo(const char *path, int argc, const char ** argv)
>>>  {
>>> -	int i;
>>>  	struct child_process child = CHILD_PROCESS_INIT;
>>>  	char *abspath = interpolate_path(path, 0);
>>>  
>>> +	clear_local_repo_env(&child.env);
>>> +
>>>  	child.git_cmd = 1;
>>>  	strvec_pushl(&child.args, "-C", abspath, NULL);
>> 
>> The second part of the hunk here is as expected, but the first one looks
>> wrong. We didn't remove any references to "i", so either it was
>> redundant to start with (and the compiler should have complained), or
>> now we've broken compilation.
>
> You are correct. I did a --fixup here and it messed up the diff. I should
> have double-checked the commit-by-commit compilation and testing post-
> rebase.
>
>> Looks like the latter, but we recover when we switch to using pushv in
>> patch 4. So I think the declaration of "i" should move to that patch.
>
> Can do. Looks like a small v4 update _is_ required.

I could do this too ;-) but I probably won't get to queuing this
topic before you update on your own, I suspect, so ...