forked from qt-creator/qt-creator
VcsManager: Fix soft assertion when directory is managed by 2 VCS
In case 2 VCS manage the same directory, topLevel will be the same for both. Chopping tmpDir gives a wrong directory for the second VC. Change-Id: Ie20c716cf8b713dae0d5d8ecc4c947f1c5029544 Reviewed-by: Knut Petter Svendsen <knutpett@pvv.org> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
0ec265259d
commit
0282b97c26
@@ -277,6 +277,9 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &input
|
||||
const QChar slash = QLatin1Char('/');
|
||||
const StringVersionControlPairs::const_iterator cend = allThatCanManage.constEnd();
|
||||
for (StringVersionControlPairs::const_iterator i = allThatCanManage.constBegin(); i != cend; ++i) {
|
||||
// If topLevel was already cached for another VC, skip this one
|
||||
if (tmpDir.count() < i->first.count())
|
||||
continue;
|
||||
d->cache(i->second, i->first, tmpDir);
|
||||
tmpDir = i->first;
|
||||
const int slashPos = tmpDir.lastIndexOf(slash);
|
||||
|
||||
Reference in New Issue
Block a user