Hello, so I am working on a simple jgit server with a DFS backend (s3 compatible block store + mysql). And while testing the reference in-memory (and my own implementation) of the repository I have encountered
a weird issue:
HEAD symbolic ref is not getting set, updated or returned by the server.
So if I push a repository to my server (both jgit and git client have this issue) and then do an ls-remote I get something like:
$ git ls-remote memory
3b5b17e2a94e08eda5c2378e3a91f0656e55ecf8 refs/heads/main
But if I ls-remote a repository on github I get:
I even encountered problems cloning non-empty repositories using jgit that only disappeared when I did a setBranch on my clone command. Otherwise I was getting:
org.eclipse.jgit.errors.TransportException: Remote branch 'HEAD' not found in upstream origin
(cgit does not have this problem even when HEAD remote symbolic ref is missing)
Unfortunately my knowledge around how HEAD symbolic ref is maintained on the server and how it is treated on the client is lacking, so I don't know where to begin diagnosing this issue.
All the code of my project is open source and you can easily reproduce the problem by commenting out:
and running out any of the integration tests.