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:
parent
4307fb96a6
commit
99b9419150
@ -330,7 +330,7 @@ QString GitClient::gitBlob(QString fileName) {
|
|||||||
if (fi.exists()) {
|
if (fi.exists()) {
|
||||||
QString const gitCommand = QString("git hash-object %1").arg(fileName);
|
QString const gitCommand = QString("git hash-object %1").arg(fileName);
|
||||||
Command c(gitCommand);
|
Command c(gitCommand);
|
||||||
if (c.execute(m_workingDirectory)) {
|
if (c.execute("/tmp")) {
|
||||||
return c.getCommandResult().trimmed();
|
return c.getCommandResult().trimmed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ class GitClient : public QObject {
|
|||||||
|
|
||||||
QString gitLastCommit(QString fileName);
|
QString gitLastCommit(QString fileName);
|
||||||
QStringList gitShowReason();
|
QStringList gitShowReason();
|
||||||
QString gitBlob(QString fileName);
|
static QString gitBlob(QString fileName);
|
||||||
QString gitCommitForBlob(QString blob);
|
QString gitCommitForBlob(QString blob);
|
||||||
bool gitIsFileTracked(QString file2name);
|
bool gitIsFileTracked(QString file2name);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user