Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
babddfb1
Commit
babddfb1
authored
Apr 25, 2021
by
Mark Nauwelaerts
Browse files
project: historywidget: show commit restricted to file
... rather than a diff from working directory to selected commit
parent
c8712236
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/project/filehistorywidget.cpp
View file @
babddfb1
...
...
@@ -220,15 +220,13 @@ void FileHistoryWidget::itemClicked(const QModelIndex &idx)
const
auto
commit
=
idx
.
data
(
CommitListModel
::
CommitRole
).
value
<
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
)
{
return
;
}
QByteArray
contents
=
commit
.
msg
.
toUtf8
();
contents
.
append
(
"
\n\n
"
);
contents
.
append
(
git
.
readAllStandardOutput
());
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment