Re: [PATCH v15 09/10] fetch: set remote/HEAD if it does not exist
- From
Josh Steadmon <steadmon@google.com>
- Date
- Dec 5, 2024, 18:58 UTC
- Message-ID
- <wmu5ld4xsfjz2tpp54jmxqroma423t5nn2jh3q5gq2wswr6fkm@vrlhigyuxfzu>
- In-Reply-To
- <20241122123138.66960-10-bence@ferdinandy.com>
On 2024.11.22 13:28, Bence Ferdinandy wrote:
Show 7 quoted lines
> When cloning a repository remote/HEAD is created, but when the user > creates a repository with git init, and later adds a remote, remote/HEAD > is only created if the user explicitly runs a variant of "remote > set-head". Attempt to set remote/HEAD during fetch, if the user does not > have it already set. Silently ignore any errors. > > Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
At $DAYJOB, we noticed that this breaks `git fetch --tags`, although I haven't had a chance to figure out what causes the error just yet.
I was able to bisect down to this commit using Jonathan Tan's reproduction script:
rm -rf test_tag_1 test_tag_2 GIT=~/git/bin-wrappers/git mkdir test_tag_1 && cd test_tag_1 REMOTE=$(pwd) $GIT init . touch foo.txt $GIT add foo.txt $GIT commit foo.txt -m "commit one" $GIT tag foo cd .. mkdir test_tag_2 && cd test_tag_2 $GIT init . echo fetch --tags $GIT fetch --tags "file://$REMOTE" echo regular fetch $GIT fetch "file://$REMOTE" 'refs/tags/*:refs/tags/*' $GIT --version
Prior to this change, the first `$GIT fetch --tags "file://$REMOTE"` fetches the `foo` tag; with this change, it does not.