Re: [PATCH v2 3/3] remote set-head: set followRemoteHEAD to "warn" if "always"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 4, 2024, 20:40 UTC
- Message-ID
- <xmqqh67j2ndc.fsf@gitster.g>
- In-Reply-To
- <cfd54be2-af8f-429f-a4c6-41f54c33c89c@app.fastmail.com>
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
Show 16 quoted lines
> On Wed, Dec 4, 2024, at 11:39, Bence Ferdinandy wrote: >> diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh >> index 7411aa770d..daf70406be 100755 >> --- a/t/t5505-remote.sh >> +++ b/t/t5505-remote.sh >> @@ -504,6 +504,17 @@ test_expect_success 'set-head --auto has no >> problem w/multiple HEADs' ' >> ) >> ' >> >> +test_expect_success 'set-head changes followRemoteHEAD always to warn' ' >> + ( >> + cd test && > > I think you need to `cd` in a subshell here. See `t/README`, “Don't > chdir around in tests.”.
Puzzled. Isn't this inside a (subshell) already?
Show 5 quoted lines
>> + git config set remote.origin.followRemoteHEAD "always" && >> + git remote set-head --auto origin && >> + git config get remote.origin.followRemoteHEAD >output && > > Nit: maybe `actual` instead of `output`? Just for uniformity.
t5505 is already heavily contaminated with the pattern to compare "expect" with "output", not with "actual", but that does not make it a good idea to make it even worse by adding more instances ;-)