File indexing completed on 2025-03-09 05:11:36

0001 /*
0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QString>
0010 
0011 namespace KommitTest
0012 {
0013 bool touch(const QString &fileName);
0014 QString getTempPath();
0015 }
0016 
0017 class GitTestManager
0018 {
0019 public:
0020     GitTestManager();
0021     bool touch(const QString &fileName);
0022     bool run(const QString &cmd);
0023 
0024     void init();
0025     void add(const QString &file = QStringLiteral("."));
0026     void remove(const QString &file, bool cached = true);
0027     void commit(const QString &message);
0028     void addToIgnore(const QString &pattern);
0029     QString absoluteFilePath(const QString &file);
0030 
0031 private:
0032     QString mPath;
0033     QString runGit(const QStringList &args);
0034 };