#ifndef GIT_CLIENT_H_INCLUDED
#define GIT_CLIENT_H_INCLUDED


#include <optional>

#include "process/command.h"


class GitClient {
    QString m_workingDirectory;
    QString m_branchName;

    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
