Move remote callbacks to an interface/object#568
Merged
jdavid merged 4 commits intolibgit2:masterfrom Sep 27, 2015
Merged
Conversation
Member
|
👍 We could support another, less verbose, way to write. Now: Or less verbose: |
Member
Author
|
That's a good idea. The credentials or certificate callbacks are some which you sometimes must provide in order to complete the operation, so it makes sense to make them easier to provide in-line. |
f6f43e8 to
46ca83c
Compare
This represents what's going on much better than the remnants from the older methods. What we do is pass a list of callbacks to libgit2 for it to call, and they are valid for a single operation, not for the remote itself. This should also make it easier to re-use callbacks which have already been set up.
This lets use the same callbacks for fetch and clone; it also fills in the callbacks which the clone function did not support.
This allows for a less verbose way of setting one-liners as these callbacks.
This was implemented for clone, but not for fetch or push, so it was deleted during the conversion, which shows why we need to unify these callback structures.
fabc79c to
563cb90
Compare
Member
Author
|
This should now give us parity in both. Through the unification we've gained the progress callbacks on clone and the certificate check on fetch and push, instead of having to implement each of them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of setting the methods/fields in the remote itself, which is a vestige of the older method which libgit2 used, have the user pass in an object with their callbacks, which represents what's going on underneath much more accurately, as well as letting us re-use the callbacks implementation across
Remoteandclone_repsitory().The docs aren't updated yet, so it's still WIP, but this is what I'd like us to move to.