有什么方法可以挂接到“git_remote_connect”使用的主机名吗?

Is there any way to hook into the host name used by `git_remote_connect`?

由于 libssh2 不读取 SSH 配置文件,我正在尝试实现自己对别名的支持,如下所示:

Host github
  HostName github.com

并且远程 URL 使用这样的主机别名:git@github:path/to/repo.git.

有什么方法可以挂接到 git_remote_connect 使用的主机名或 URL 或 SSH 传输,以便我可以将 github 转换为 github.com?我正在考虑添加一个新的回调,但如果已经有办法做到这一点,我不想重新发明轮子。

我最终添加了一个 new callback 来查找遥控器的 URL。它不在上游 libgit2 中,但如果它对其他人有用,它可能是。