Commit babddfb1 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

project: historywidget: show commit restricted to file

... rather than a diff from working directory to selected commit
parent c8712236
......@@ -220,15 +220,13 @@ void FileHistoryWidget::itemClicked(const QModelIndex &idx)
const auto commit =<Commit>();
QStringList args{QStringLiteral("diff"), QString::fromUtf8(commit.hash), QStringLiteral("--"), m_file};
QStringList args{QStringLiteral("show"), QString::fromUtf8(commit.hash), QStringLiteral("--"), m_file};
git.start(QStringLiteral("git"), args, QProcess::ReadOnly);
if (git.waitForStarted() && git.waitForFinished(-1)) {
if (git.exitStatus() != QProcess::NormalExit || git.exitCode() != 0) {
QByteArray contents = commit.msg.toUtf8();
QByteArray contents(git.readAllStandardOutput());
// we send this signal to the parent, which will pass it on to
// the GitWidget from where a temporary file is opened
Q_EMIT commitClicked(contents);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment