-
-
Notifications
You must be signed in to change notification settings - Fork 346
Trying to fetch only non-existant refs results in "Could not decode server reply" #1405
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
Comments
Thanks for reporting! I think this needs more code in order to reproduce it as I don't get this particular error when trying it with
The message to the user isn't quite as descriptive as the one Git produces, but it's far-fetched from running into an obscure error as well. Maybe take a look at the Thanks for your help with this. |
Did you try the included reproduction? I tried it now, and I'm also getting it on Windows:
|
Incredible, I missed it. Research
Git does:
All receive:
Which is met with a completely empty response, something that it doesn't like.
It looks like the problem is that it doesn't stop in time - after all, there is no refspec match, so it can't "want" anything, yet here we are. It's notable that Finally, it turned out that
Preparing a fix now. |
Previously, when a shallow operation was specified, it was possible to skip past the no-change test and attempt to negotiate even though there was nothing to want. This is now 'fixed' by simply aborting early if there is no refspec mapping at all. Further, it aborts as early as possible with a nicer error message, after all, there is no use in having no mapping.
Once the related PR is merged, it will print the following (as error):
|
Previously, when a shallow operation was specified, it was possible to skip past the no-change test and attempt to negotiate even though there was nothing to want. This is now 'fixed' by simply aborting early if there is no refspec mapping at all. Further, it aborts as early as possible with a nicer error message, after all, there is no use in having no mapping. Note that it's explicitly implemented such that obtaining such an empty refmap is fine, but trying to receive it is not. That way, the user can obtain information about the server without anything being an error.
Previously, when a shallow operation was specified, it was possible to skip past the no-change test and attempt to negotiate even though there was nothing to want. This is now 'fixed' by simply aborting early if there is no refspec mapping at all. Further, it aborts as early as possible with a nicer error message, after all, there is no use in having no mapping. Note that it's explicitly implemented such that obtaining such an empty refmap is fine, but trying to receive it is not. That way, the user can obtain information about the server without anything being an error.
Updated and tested the reproduction, and this issue seems like it's been fixed. Thank you! |
Current behavior 😯
If you try to fetch a non-existant ref over https (github specifically), you get a vague error indicating that:
Expected behavior 🤔
I'm not sure what to expect. But I hoped that the protocols involved would indicate that the references do not exist, and a better error message propagated to the user. Alternatively that the
outcome
would simply not be populated, and any refs specified which does not exist are simply ignored which is what happens if you do specify refs that exist alongside ones which do not.Maybe this isn't an error at all, and I'm simply expected to enumerate the remote refs before attempting to fetch them, all though this would be racy since the refs can change between enumeration and fetching.
Git behavior
git fetch https://github.com/dtolnay/rust-toolchain refs/tags/stable fatal: couldn't find remote ref refs/tags/stable
Steps to reproduce 🕹
Note that I can only reproduce this on Linux
, on Windows it seems to work as expected for some reason.I've set up a minimal repro here where I try to fetch
refs/tags/stable
fromdtolnay/rust-toolchain
. Note thatrefs/heads/stable
is actually what exists.See: https://github.com/udoprog/playground/tree/gix-issue2
Rust version:
The text was updated successfully, but these errors were encountered: