Git: InstantBlame: Reuse existing git function

Change-Id: Ibad43045d4603c3551afc3a3e1870edac078ef7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2025-01-12 22:13:23 +01:00
committed by André Hartmann
parent 4f2928b5af
commit e2b4b14fe3

View File

@@ -308,15 +308,13 @@ void InstantBlame::setup()
static CommitInfo parseBlameOutput(const QStringList &blame, const Utils::FilePath &filePath,
int line, const Git::Internal::Author &author)
{
static const QString uncommittedHash(40, '0');
CommitInfo result;
if (blame.size() <= 12)
return result;
const QStringList firstLineParts = blame.at(0).split(" ");
result.hash = firstLineParts.first();
result.modified = result.hash == uncommittedHash;
result.modified = !gitClient().isValidRevision(result.hash);
if (result.modified) {
result.author = Tr::tr("Not Committed Yet");
result.subject = Tr::tr("Modified line in %1").arg(filePath.fileName());