Made gitBlob() static and execute in /tmp as this command can be executed

for every file not only the files contained in a git repository.
This commit is contained in:
Gerhard Hoffmann 2023-08-22 12:19:25 +02:00
parent 4307fb96a6
commit 99b9419150
2 changed files with 2 additions and 2 deletions

View File

@ -330,7 +330,7 @@ QString GitClient::gitBlob(QString fileName) {
if (fi.exists()) {
QString const gitCommand = QString("git hash-object %1").arg(fileName);
Command c(gitCommand);
if (c.execute(m_workingDirectory)) {
if (c.execute("/tmp")) {
return c.getCommandResult().trimmed();
}
}

View File

@ -51,7 +51,7 @@ class GitClient : public QObject {
QString gitLastCommit(QString fileName);
QStringList gitShowReason();
QString gitBlob(QString fileName);
static QString gitBlob(QString fileName);
QString gitCommitForBlob(QString blob);
bool gitIsFileTracked(QString file2name);
};