Re: [PATCH v3 3/4] for-each-repo: work correctly in a worktree
From: Junio C Hamano <hidden>
Date: 2026-03-02 21:32:31
Derrick Stolee [off-list ref] writes:
On 3/2/2026 1:06 PM, Jeff King wrote:quoted
On Mon, Mar 02, 2026 at 03:36:44PM +0000, Derrick Stolee via GitGitGadget wrote:quoted
@@ -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.quoted
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 ...