pygit2
/内から参照をプッシュしようとしていますlibgit2
:
push_refspec = git_repo.lookup_reference('HEAD').resolve().name
logger.info("Pushing " + push_refspec)
git_remote.push(push_refspec)
ただし、資格情報が見つからないというエラーが表示されます。
_pygit2.GitError: Cannot set up SSH connection without credentials
これは最終的に( )libssh2
からの呼び出しを介して取得されます。libgit2
transports/ssh.c
if (user && pass) {
if (git_cred_userpass_plaintext_new(&t->cred, user, pass) < 0)
goto on_error;
} else if (t->owner->cred_acquire_cb) {
if (t->owner->cred_acquire_cb(
&t->cred, t->owner->url, user,
GIT_CREDTYPE_USERPASS_PLAINTEXT |
GIT_CREDTYPE_SSH_KEY |
GIT_CREDTYPE_SSH_CUSTOM,
t->owner->cred_acquire_payload) < 0)
goto on_error;
if (!t->cred) {
giterr_set(GITERR_SSH, "Callback failed to initialize SSH credentials");
goto on_error;
}
} else {
giterr_set(GITERR_SSH, "Cannot set up SSH connection without credentials");
goto on_error;
}
Git クライアントを使用したリポジトリからのApush
は問題なく動作します。GIT_SSL_NO_VERIFY=true
私は(当然のことながら)うまくいかなかったものを試しました。
これを機能させるには、どのような追加情報を設定する必要がありますか?