libgit2
libgit2 copied to clipboard
add callback before a remote connects and add a callback before a remote will be disconnected
Problem Description: When updating submodules, the remote of the submodule is not visible outside of the submodule (submodule is a private type and therefore not intended to be used outside). So in that case it is not possible to abort an update operation by aborting the remote connection.
Benefit: If during the submodule update (fetch, ...) a callback will be called, outside of the submodule the remote is available. This remote can be stored and if the application wants to abort the operation it just stops the operation on that remote.
from #5730 In this particular case, I added the connect/disconnect callbacks because I needed to remember the remote to cancel the transfer later on. This is most important in submodule update, which looks up the remotes internally. Without this, there isn't a way to cancel the transfers initiated by submodule update.
TODO: Maybe it is possible to just define the disconnect and the remote_ready_cb can be used instead of the connect
Why git_remote_ready_cb remote_ready; is not defined as GIT_CALLBACK()?
Why git_remote_ready_cb remote_ready; is not defined as GIT_CALLBACK()?
It is - https://github.com/libgit2/libgit2/blob/258df9c18d4876ad59a2cfa9d78a313f867d633e/include/git2/remote.h#L538 ? 🤔
Why git_remote_ready_cb remote_ready; is not defined as GIT_CALLBACK()?
It is -
https://github.com/libgit2/libgit2/blob/258df9c18d4876ad59a2cfa9d78a313f867d633e/include/git2/remote.h#L538 ? 🤔
Ah I haven't seen this thanks. Is this the way it should be added to the struct? So I will change it for my callbacks too
Current error in the tests: "remote error: The unauthenticated git protocol on port 9418 is no longer supported. Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information. "
TODO: use a different repo, because fetching libgit2 takes quite long.
@ethomson which repo do you propose?
@ethomson