Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot handle empty ReferenceUpdateRequest #1014

Open
scabala opened this issue Jan 29, 2024 · 0 comments
Open

Cannot handle empty ReferenceUpdateRequest #1014

scabala opened this issue Jan 29, 2024 · 0 comments

Comments

@scabala
Copy link

scabala commented Jan 29, 2024

Hello,
I've been trying to implement a Git server using this library. I have encountered an issue when pushing to it. When pushing first time with some commits present in local repo that are not in remote repo, everything is fine. When I try to push again immediately afterwards, push fails. The same action works fine for GitHub, GitLab and other git services.

I have used example from here.

I have done some debugging and pinned it down to updReqDecoder's Decode method. From my investigation, it turns out that git client responds with just flush-pkt line when there are no refs to be updated - in other words, nothing to push by client. However, ReferenceUpdateRequest and its decoder, is coded in such a way that it always expects some refs being sent. That causes it to fail with capabilities delimiter not found - it comes from here.

I've looked at ReferenceUpdateRequest and it is not straightforward for me how to fix it - maybe someone else have better idea? Nonetheless, I can craft a PR if you are willing to accept it.

Thanks for all the hard work on go-git!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant