forked from qt-creator/qt-creator
Core: Add a convenience findTopLevelForDirectory to VcsManager
Change-Id: If5a846e0793b25b738084cacb8dba51fb80399d4 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
8a1bb5aeb3
commit
342cb69dda
@@ -108,10 +108,9 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
VariableManager::registerVariable(Constants::VAR_VCS_TOPLEVELPATH,
|
||||
tr("The top level path to the repository the current project is in."),
|
||||
[]() -> QString {
|
||||
QString topLevel;
|
||||
if (Project *project = ProjectExplorerPlugin::currentProject())
|
||||
VcsManager::findVersionControlForDirectory(project->projectDirectory().toString(), &topLevel);
|
||||
return topLevel;
|
||||
return VcsManager::findTopLevelForDirectory(project->projectDirectory().toString());
|
||||
return QString();
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user