public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Bence Ferdinandy" <bence@ferdinandy•com>
To: "Junio C Hamano" <gitster@pobox•com>, "Patrick Steinhardt" <ps@pks•im>
Cc: <git@vger•kernel.org>, "Christian Hesse" <mail@eworm•de>,
	"Christian Hesse" <list@eworm•de>
Subject: Re: [PATCH] fetch set_head: fix non-mirror remotes in bare repositories
Date: Sun, 26 Jan 2025 23:01:14 +0100	[thread overview]
Message-ID: <D7CCDAZ9CWQ9.28LRY70X1JBAZ@ferdinandy.com> (raw)
In-Reply-To: <xmqqldv0p559.fsf@gitster.g>


On Fri Jan 24, 2025 at 17:07, Junio C Hamano <gitster@pobox•com> wrote:
> Patrick Steinhardt <ps@pks•im> writes:
>
>>> diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
>>> index 2d9587059f..cfa63ae086 100755
>>> --- a/t/t5510-fetch.sh
>>> +++ b/t/t5510-fetch.sh
>>> @@ -84,6 +84,19 @@ test_expect_success "fetch test remote HEAD" '
>>>  	branch=$(git rev-parse refs/remotes/origin/main) &&
>>>  	test "z$head" = "z$branch"'
>>>  
>>> +test_expect_success "fetch test remote HEAD in bare repository" '
>>> +	cd "$D" &&
>>> +	git init --bare barerepo &&
>>> +	cd barerepo &&
>>
>> The `cd` needs to happen in a subshell. ALso, the same comment here
>> regarding whether we want to have `test_when_finished` to clean up
>> state.
>
> Yes, indeed.  The change to another script we saw earlier followed
> the "chdir around only in a subshell" pattern.
>
>> I see though that you simply follow existing code style, both for the
>> call to cd(1) and for the single-quote, so these are fine. This test
>> file could use a makeover, but that is obviously outside of the scope of
>> this patch series.
>
> Terminating quote can stay, but chdir is a correctness issue that
> may want to be addressed minimally (i.e. not making things worse,
> while leaving it for later to clean up the existing ones).

I'll be sending the fix with also the terminating quote fixed as well. Actually
tests after this which I added for followremotehead followed the correct style
so why not here as well ...

5505 remote also has some style issues that came up before so if I find some
time I'll probably send a patches cleaning the up both.

>
> Thanks.




-- 
bence.ferdinandy.com


  reply	other threads:[~2025-01-26 22:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-11 19:26 fatal: Not a valid object name HEAD Christian Hesse
2025-01-12 14:17 ` Bence Ferdinandy
2025-01-13 16:30   ` Junio C Hamano
2025-01-12 16:51 ` [PATCH] fetch set_head: fix non-mirror remotes in bare repositories Bence Ferdinandy
2025-01-23 21:00   ` Junio C Hamano
2025-01-23 21:42     ` Bence Ferdinandy
2025-01-23 22:00       ` Eric Sunshine
2025-01-24 14:07     ` Christian Hesse
2025-01-24 17:17       ` Junio C Hamano
2025-01-24  5:56   ` Patrick Steinhardt
2025-01-24 10:30     ` Eric Sunshine
2025-01-24 16:07     ` Junio C Hamano
2025-01-26 22:01       ` Bence Ferdinandy [this message]
2025-01-26 22:01     ` Bence Ferdinandy
2025-01-26 22:02     ` [PATCH v2 1/2] fetch set_head: refactor to use remote directly Bence Ferdinandy
2025-01-26 22:02       ` [PATCH v2 2/2] fetch set_head: fix non-mirror remotes in bare repositories Bence Ferdinandy
2025-01-27  7:30         ` Patrick Steinhardt
2025-01-27 20:18           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D7CCDAZ9CWQ9.28LRY70X1JBAZ@ferdinandy.com \
    --to=bence@ferdinandy$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=list@eworm$(echo .)de \
    --cc=mail@eworm$(echo .)de \
    --cc=ps@pks$(echo .)im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox