1
0
mirror of https://github.com/QRouland/UTPass.git synced 2026-01-10 03:26:57 +00:00

Fix bug causing crashes during git clone when no username is provided

This commit is contained in:
2025-02-04 14:09:02 +01:00
parent 5582b4dd70
commit bf7c2091b7
4 changed files with 42 additions and 37 deletions

View File

@@ -25,27 +25,27 @@ int GitJob::credentialsCB(git_cred **out, const char *url, const char *username_
auto v = overload {
[](const HTTP & x)
{
qDebug() << "credentialsCB : HTTP ";
qWarning() << "credentialsCB : callback should never be call for HTTP ";
qDebug() << "[GitJob] credentialsCB : HTTP ";
qWarning() << "[GitJob] credentialsCB : callback should never be call for HTTP ";
return (int) GIT_EUSER;
},
[&out, &username_from_url](const HTTPUserPass & x)
{
qDebug() << "credentialsCB : HTTPUserPass ";
qDebug() << "[GitJob] credentialsCB : HTTPUserPass ";
if (!username_from_url) {
qWarning() << "credentials_cb : no username provided ";
qWarning() << "[GitJob] credentials_cb : no username provided ";
return (int) GIT_EUSER;
}
return git_cred_userpass_plaintext_new(out, username_from_url, x.pass.toLocal8Bit().constData());
},
[](const SSHPass & x)
{
qWarning() << "credentials_cb : SSHAuth to be implemented ";
qWarning() << "[GitJob] credentials_cb : SSHAuth to be implemented ";
return (int) GIT_EUSER;
}, // TODO
[](const SSHKey & x)
{
qWarning() << "credentials_cb : SSHKey to be implemented ";
qWarning() << "[GitJob] credentials_cb : SSHKey to be implemented ";
return (int) GIT_EUSER;
} // TODO
};