-
Notifications
You must be signed in to change notification settings - Fork 397
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
The error caused by failed push_negotiation
is strange: "config value 'pack.windowMemory' was not found"
#1042
Comments
push_negotiation
is very strange and unhelpfulpush_negotiation
is strange: "config value 'pack.windowMemory' was not found"
Thanks for the report! That is indeed weird. It looks like this has been fixed in 1.8, which responds with the error:
So I believe this should be resolved once #1032 is merged. It doesn't report the error from the callback, though. I opened #1043 to fix that (and a few other places). |
Sounds great, thank you very much! How would I check for this error in code? Is there a name for I also realized that even if there isn't a good way, this should be easy to work around. I can probably just record the error myself (and optionally record any data I want about it): let mut push_negotiation_error = false;
let mut callbacks = RemoteCallbacks::new();
callbacks.push_negotiation(|updates| {
if condition {
push_negotiation_error = true
Err(crate::Error::from_str("rejected"))
} else {
Ok(())
}
});
let mut options = PushOptions::new();
options.remote_callbacks(callbacks);
let result = remote.push(&["refs/heads/main"], Some(&mut options));
if push_negotiation_error {
assert!(result.is_err());
// Handle push negotiation error
}
if let Err(err) = result {
// Handle other errors
} |
Here is the link to the libgit2 PR that fixed this issue (for version 1.8.0); it has some more details. |
I believe class 26 is |
First of all, thank you so much for implementing this!
I'd like to be able to tell whether a push failure is caused by a failed push negotiation. However, the error currently returned by a push negotiation is very strange. For example, I added a simple
dbg!
to the provided test:The
dbg!
shows that the error is the following unhelpful, and likely unintended, error:I'm not sure what it means.
This is at commit 04427a3. I'm on Apple Silicon Mac OS Sonoma 14.4.1:
Cc: @karin0 @ehuss @samueltardieu #926
The text was updated successfully, but these errors were encountered: