Server version is same as client (v2.42.0) as I ran these commands all
on the same machine.
Test on ssh server:
$ git -v --build-options
#Output
git version 2.42.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
Thanks
Sheik
On 30/10/23 20:36, Jeff King wrote:
On Thu, Oct 26, 2023 at 07:36:36AM +1100, Sheik wrote:
Repository cloned using SSH does not use the branch configured in the bare
repository however repository cloned using filesystem does as expected.
Shouldn't they both behave the same?
What version of Git is running on the ssh server?
Your example seems to show that the parent repository has an unborn
branch (i.e., HEAD points to "refs/heads/test", but there are no commits
yet). I think the server-side bits you need for that to work showed up
in 59e1205d16 (ls-refs: report unborn targets of symrefs, 2021-02-05),
which is in v2.31.
So even though your client seems to be v2.42 (from the output you gave),
if the server is older it may not be sending sufficient information.
There were also some other fixes on top of that, but I _think_ they were
all client-side (so your v2.42 clone command should be doing the right
thing).
-Peff