1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-07-04 03:02:28 +00:00

Setup git libs for Pass plugin

This commit is contained in:
2025-01-07 20:55:30 +01:00
parent 7418894456
commit d33932be6d
7 changed files with 27 additions and 22 deletions

View File

@ -20,7 +20,13 @@ Git::~Git() {
git_libgit2_shutdown();
}
bool Git::clone(QString url)
{
return false;
bool Git::clone(QString url, QString path) {
git_repository *repo = NULL;
git_clone_options opts = GIT_CLONE_OPTIONS_INIT;
int ret = git_clone(&repo, url.toLocal8Bit().data(), path.toLocal8Bit().data(), &opts);
if (repo) {
git_repository_free(repo);
}
return ret == 0; // TODO better error handling to return specifics errors for the ui
}

View File

@ -21,7 +21,7 @@ public:
Git(Git const &) = delete;
void operator=(Git const &) = delete;
bool clone(QString url);
bool clone(QString url, QString path);
};
#endif

View File

@ -70,5 +70,5 @@ QString Pass::getPasswordStore()
bool Pass::gitClone(QString url)
{
qInfo() << "Cloning . password_store from " << url;
return Git::instance()->clone(url);
return Git::instance()->clone(url, m_password_store);
}

View File

@ -7,7 +7,6 @@
#include <QEventLoop>
#include <QSemaphore>
#include <gpgme++/interfaces/passphraseprovider.h>
#include "passphraseprovider.h"
#include "gpg.h"