VCS: Resolve symlinks on blame

Fixes: QTCREATORBUG-20792
Change-Id: I60ac64957b23b80826c93ba73ff17a265549811f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Orgad Shaneh
2022-10-13 20:38:40 +03:00
committed by Orgad Shaneh
parent 46df40a919
commit 424fd7c557
2 changed files with 8 additions and 4 deletions

View File

@@ -1055,8 +1055,12 @@ void GitPluginPrivate::blameFile()
}
}
}
VcsBaseEditorWidget *editor = m_gitClient.annotate(state.currentFileTopLevel(),
state.relativeCurrentFile(), {}, lineNumber, extraOptions);
const FilePath fileName = FilePath::fromString(state.currentFile()).canonicalPath();
FilePath topLevel;
VcsManager::findVersionControlForDirectory(fileName.parentDir(), &topLevel);
VcsBaseEditorWidget *editor = m_gitClient.annotate(
topLevel, fileName.relativeChildPath(topLevel).toString(),
{}, lineNumber, extraOptions);
if (firstLine > 0)
editor->setFirstLineNumber(firstLine);
}

View File

@@ -1450,9 +1450,9 @@ void VcsBaseEditorWidget::addDiffActions(QMenu *, const DiffChunk &)
void VcsBaseEditorWidget::slotAnnotateRevision(const QString &change)
{
const int currentLine = textCursor().blockNumber() + 1;
const FilePath fileName = FilePath::fromString(fileNameForLine(currentLine));
const FilePath fileName = FilePath::fromString(fileNameForLine(currentLine)).canonicalPath();
const FilePath workingDirectory = d->m_workingDirectory.isEmpty()
? fileName.absolutePath()
? VcsManager::findTopLevelForDirectory(fileName.parentDir())
: d->m_workingDirectory;
emit annotateRevisionRequested(workingDirectory,
fileName.relativeChildPath(workingDirectory).toString(),