Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] HEAD symbolic ref is not being set up when pushing a repository

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:

$ git ls-remote https://github.com/Ignas/nukagit
5f97643f20b22706311e89576a31401c30a60c7b HEAD
5f97643f20b22706311e89576a31401c30a60c7b refs/heads/main

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.

Thank you for your time,
Ignas

Back to the top