forked from qt-creator/qt-creator
Git: InstantBlame: Reuse existing git function
Change-Id: Ibad43045d4603c3551afc3a3e1870edac078ef7e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
André Hartmann
parent
4f2928b5af
commit
e2b4b14fe3
@@ -308,15 +308,13 @@ void InstantBlame::setup()
|
|||||||
static CommitInfo parseBlameOutput(const QStringList &blame, const Utils::FilePath &filePath,
|
static CommitInfo parseBlameOutput(const QStringList &blame, const Utils::FilePath &filePath,
|
||||||
int line, const Git::Internal::Author &author)
|
int line, const Git::Internal::Author &author)
|
||||||
{
|
{
|
||||||
static const QString uncommittedHash(40, '0');
|
|
||||||
|
|
||||||
CommitInfo result;
|
CommitInfo result;
|
||||||
if (blame.size() <= 12)
|
if (blame.size() <= 12)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
const QStringList firstLineParts = blame.at(0).split(" ");
|
const QStringList firstLineParts = blame.at(0).split(" ");
|
||||||
result.hash = firstLineParts.first();
|
result.hash = firstLineParts.first();
|
||||||
result.modified = result.hash == uncommittedHash;
|
result.modified = !gitClient().isValidRevision(result.hash);
|
||||||
if (result.modified) {
|
if (result.modified) {
|
||||||
result.author = Tr::tr("Not Committed Yet");
|
result.author = Tr::tr("Not Committed Yet");
|
||||||
result.subject = Tr::tr("Modified line in %1").arg(filePath.fileName());
|
result.subject = Tr::tr("Modified line in %1").arg(filePath.fileName());
|
||||||
|
Reference in New Issue
Block a user