From: Junio C Hamano Date: Wed, 04 Sep 2024 20:55:32 GMT Subject: Re: [PATCH] remote: prefetch config Message-ID: In-Reply-To: Derrick Stolee writes: > I agree that this would also be of interest, but more complicated. Thanks > for starting with this simpler modification. > >> + if (remote->prefetch == 0) >> + return 0; > > In the Git codebase, this would normally be written as > > if (!remote->prefetch) > return 0; ;-) >> + # Run maintenance prefetch task >> + GIT_TRACE2_EVENT="$(pwd)/prefetch.txt" git maintenance run --task=prefetch 2>/dev/null && >> + >> + # Check that remote1 was not fetched (prefetch=false) >> + test_subcommand ! git fetch remote1 --prefetch --prune --no-tags \ >> + --no-write-fetch-head --recurse-submodules=no --quiet \ >> + > I'm happy to see this use of test_subcommand to validate the behavior > of this patch! I found it a bit disturbing that the pattern is overly specific. The only thing we are interested in is that we are not fetching from remote1, so it _should_ suffice if we could write test_subcommand ! git fetch remote1