-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fire progress and update tips callbacks also for pushes. #2284
Conversation
We should probably also run the online tests, not sure how to do this? |
Some travis failure :( Will fix it. |
|
Don't you think if you need to be able to cancel the operation, it would be better suited to do it in i.e. |
I actually feel that |
Actually the test case failure that I had was attributed to the naming confusion 😄 Checked the incorrect callback... |
The main use-case here is for bindings. If e.g. we see an exception getting raised from Ruby-Land in Rugged, we need to somehow signal that to libgit2, and correctly abort the current operation. |
Fair enough. |
It's not very useful to only know that a pre-receive hook has declined a push, you probably want to know why.
@jacquesg 'progress' is the channel used to transmit said data. |
Ok well, then we should probably not change it :) |
I've changed it so the return code of callbacks are checked. If |
Current (wanted) behaviour is to propagate the error from the caller. |
Ok, so the user is required to return |
I also think that |
We could call it |
|
The user may have requested that the operation be cancelled.
Turns out that we are also never executing |
Comments? |
Looks good to me. @carlosmn? |
Probably ok unless someone still wants to review but hasn't gotten round to it? |
Fire progress and update tips callbacks also for pushes.
Fire progress and update tips callbacks also for pushes.
It's not very useful to only know that a pre-receive hook has declined a push, you probably want to know why. We were only firing of the progress callback for fetch operations.
I've also fixed a leak here if you return
< 0
in the callback (and cleaned it up a little) and made it only not fire any more callbacks of that type if you return< 0
. I don't think that on receiving a text message from the remote should allow you to cancel the operation. Normally if the operation should not succeed, the remote side will anyway force failure (cancellation) by not allowing the push/fetch to continue.