Git: Fix soft asserts on failing instant blame

When git blame returns no output, silently avoid creating
annotations instead flooding soft asserts.

This situation can easily happen when navigating to a
header file that is not under version control.

Fixes: QTCREATORBUG-28768
Change-Id: I8d2f443dec98575221995a9016bd2f8442c682cf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2023-02-19 15:41:55 +01:00
committed by André Hartmann
parent 10dc4f93f4
commit b9af26adf3

View File

@@ -1502,7 +1502,8 @@ CommitInfo parseBlameOutput(const QStringList &blame, const Utils::FilePath &fil
const Git::Internal::Author &author)
{
CommitInfo result;
QTC_ASSERT(blame.size() > 12, return result);
if (blame.size() <= 12)
return result;
result.sha1 = blame.at(0).left(40);
result.author = blame.at(1).mid(7);