aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2022-10-13 20:38:40 +0300
committerOrgad Shaneh <orgads@gmail.com>2022-10-14 11:32:14 +0000
commit424fd7c557907c03cb957fadc90cd81f87063f5d (patch)
tree63ce223c607afeadbb4c0946a6f697c8d05f19ff /src/plugins/git
parent46df40a91904edf500e4cf5ab234f5054348258c (diff)
VCS: Resolve symlinks on blame
Fixes: QTCREATORBUG-20792 Change-Id: I60ac64957b23b80826c93ba73ff17a265549811f Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/plugins/git')
-rw-r--r--src/plugins/git/gitplugin.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index d93b66f4f7..a6bdfbf32e 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -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);
}