diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2013-10-30 11:21:20 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2013-11-20 10:12:11 +0100 |
commit | 0282b97c2668cd6b438523a718890ef465eacaf3 (patch) | |
tree | 57ca5bac38aa93e7539b0e0d83a1e6f2f3083833 /src/plugins/coreplugin/vcsmanager.cpp | |
parent | 0ec265259db6e84d924ae2fd2c9ed4a38f324b3c (diff) | |
download | qt-creator-0282b97c2668cd6b438523a718890ef465eacaf3.tar.gz |
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>
Diffstat (limited to 'src/plugins/coreplugin/vcsmanager.cpp')
-rw-r--r-- | src/plugins/coreplugin/vcsmanager.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index 4e2636a908..acfeb9145d 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -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); |