Git: InstantBlame: Make uncommited line info translatable

The orginal output from git is:
* "Not Committed Yet" for the author
* "Version of %1 from %1" for the subject

Fixes: QTCREATORBUG-32093
Change-Id: I541895b079880727ea0a47d1b4fda8c80b6d313c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Olivier Delaune <olivier+qt@delaune.info>
This commit is contained in:
Andre Hartmann
2025-02-09 16:08:10 +01:00
committed by André Hartmann
parent 3be9916cf2
commit f1649ae93a

View File

@@ -303,15 +303,20 @@ static CommitInfo parseBlameOutput(const QStringList &blame, const Utils::FilePa
const QStringList firstLineParts = blame.at(0).split(" ");
result.hash = firstLineParts.first();
result.modified = result.hash == uncommittedHash;
if (result.modified) {
result.author = Tr::tr("Not Committed Yet");
result.subject = Tr::tr("Modified line in %1").arg(filePath.fileName());
} else {
result.author = blame.at(1).mid(7);
result.authorMail = blame.at(2).mid(13).chopped(1);
result.subject = blame.at(9).mid(8);
}
if (result.author == author.name || result.authorMail == author.email)
result.shortAuthor = Tr::tr("You");
else
result.shortAuthor = result.author;
const uint timeStamp = blame.at(3).mid(12).toUInt();
result.authorDate = QDateTime::fromSecsSinceEpoch(timeStamp);
result.subject = blame.at(9).mid(8);
result.filePath = filePath;
// blame.at(10) can be "boundary", "previous" or "filename"
if (blame.at(10).startsWith("filename"))