Git: Enable instant blame only if current file is managed

If the current project is Git managed, but the user opens a header from an
unmanaged directory, don't try to run blame.

Change-Id: I563f7a687b2ea03f4c03bf97c8f5c27c1f8411ec
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2022-11-21 15:06:55 +02:00
committed by Orgad Shaneh
parent fa1adf4d40
commit a2baeea394

View File

@@ -1447,7 +1447,7 @@ void GitPluginPrivate::setupInstantBlame()
return;
}
const Utils::FilePath workingDirectory = GitPlugin::currentState().topLevel();
const Utils::FilePath workingDirectory = GitPlugin::currentState().currentFileTopLevel();
if (workingDirectory.isEmpty())
return;
m_author = GitClient::instance()->getAuthor(workingDirectory);