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:
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <QEventLoop>
|
||||
#include <QSemaphore>
|
||||
#include <gpgme++/interfaces/passphraseprovider.h>
|
||||
#include "passphraseprovider.h"
|
||||
#include "gpg.h"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user