Skip to content
GitLab
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
b30c80f9
Commit
b30c80f9
authored
Jan 05, 2022
by
Waqar Ahmed
Browse files
Ignore error if not a git repo or empty repo
parent
007d40fd
Pipeline
#119782
passed with stage
in 3 minutes and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
addons/git-blame/kategitblameplugin.cpp
View file @
b30c80f9
...
...
@@ -317,8 +317,15 @@ void KateGitBlamePluginView::sendMessage(const QString &text, bool error)
void
KateGitBlamePluginView
::
blameFinished
(
int
exitCode
,
QProcess
::
ExitStatus
exitStatus
)
{
if
(
exitCode
!=
0
||
exitStatus
!=
QProcess
::
NormalExit
)
{
const
auto
error
=
m_blameInfoProc
.
readAllStandardError
();
// Ignore, this repo doesn't have any commits or not a repo
if
(
error
.
startsWith
(
"fatal: no such ref: HEAD"
)
||
error
.
startsWith
(
"fatal: not a git repository"
))
{
return
;
}
QString
text
=
i18n
(
"Git blame failed."
);
sendMessage
(
text
+
QStringLiteral
(
"
\n
"
)
+
QString
::
fromUtf8
(
m_blameInfoProc
.
readAllStandardE
rror
()
),
true
);
sendMessage
(
text
+
QStringLiteral
(
"
\n
"
)
+
QString
::
fromUtf8
(
e
rror
),
true
);
return
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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