2025-01-10 13:48:38 +01:00
|
|
|
#ifndef GIT_H
|
|
|
|
#define GIT_H
|
|
|
|
|
|
|
|
#include <QUrl>
|
|
|
|
#include <QObject>
|
2025-01-13 17:59:08 +01:00
|
|
|
#include <QtCore/QDir>
|
2025-01-10 13:48:38 +01:00
|
|
|
|
2025-01-13 17:59:08 +01:00
|
|
|
#include "libgit.h"
|
2025-01-10 13:48:38 +01:00
|
|
|
|
2025-01-14 08:15:03 +01:00
|
|
|
/**
|
|
|
|
* @brief The Git class is class that provide Git functionnly to clone and update a repo.
|
|
|
|
*/
|
2025-01-10 13:48:38 +01:00
|
|
|
class Git : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2025-01-13 17:59:08 +01:00
|
|
|
private:
|
2025-01-14 08:15:03 +01:00
|
|
|
QDir cloneSetup();
|
|
|
|
bool moveToDestination(QString path, QDir tmp_dir);
|
|
|
|
bool cloneTearDown(QDir tmp_dir);
|
2025-01-13 17:59:08 +01:00
|
|
|
bool clone(QString url, QString path, mode_type mode);
|
|
|
|
|
|
|
|
|
2025-01-10 13:48:38 +01:00
|
|
|
public:
|
2025-01-10 13:58:46 +01:00
|
|
|
Git() = default;
|
2025-01-10 13:48:38 +01:00
|
|
|
~Git() override = default;
|
|
|
|
|
2025-01-14 08:15:03 +01:00
|
|
|
Q_INVOKABLE bool cloneHttp(QString url, QString path);
|
|
|
|
Q_INVOKABLE bool cloneHttpPass(QString url, QString path, QString pass);
|
2025-01-13 17:59:08 +01:00
|
|
|
// Q_INVOKABLE bool clone_ssh_pass(QString url, QString path, QString pass);
|
|
|
|
// Q_INVOKABLE bool clone_ssh_key(QString url, QString path, QString pub_key, QString priv_key, QString passphrase);
|
2025-01-10 13:48:38 +01:00
|
|
|
// Q_INVOKABLE bool update(QUrl url, QString path);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|