ATBUpdateTool/git/git_client.h

42 lines
1.2 KiB
C
Raw Normal View History

#ifndef GIT_CLIENT_H_INCLUDED
#define GIT_CLIENT_H_INCLUDED
2023-07-14 13:10:55 +02:00
#include <QObject>
#include <optional>
#include "process/command.h"
2023-07-14 13:10:55 +02:00
class Worker;
class GitClient : public QObject {
Q_OBJECT
2023-07-14 13:10:55 +02:00
Worker *m_worker;
QString const m_repositoryPath;
QString const m_customerId;
QString const m_workingDirectory;
QString const m_branchName;
QString const m_customerRepository;
std::optional<QString> gitCloneRepository(QString const &repPath);
bool gitCheckout(QString const &branchName);
public:
explicit GitClient(QString const &workingDirectory = QCoreApplication::applicationDirPath(),
QString const &branchName = "master");
void setWorkingDirectory(QString const &workingDirectory);
QString workingDirectory() const;
void setBranchName(QString const &branchName);
QString branchName() const;
std::optional<QString> gitCloneBranch(QString const &repPath, QString const &branchName);
std::optional<QString> gitFetch();
bool gitFetchAndDiff();
bool gitPull();
std::optional<QStringList> gitDiff(QString const &commit);
std::optional<QStringList> gitMerge();
};
#endif // GIT_CLIENT_H_INCLUDED