VcsManager: Clear topLevel directory when necessary

Clear the topLevelDirectory when being asked to find the version
control system responsible for directory "".

Change-Id: I8806ebff1200f0fc936715ffab94acf1f10cb386
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Tobias Hunger
2013-11-28 14:20:46 +01:00
parent 7d266c648e
commit 630e535658

View File

@@ -233,8 +233,11 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &input
{
typedef QPair<QString, IVersionControl *> StringVersionControlPair;
typedef QList<StringVersionControlPair> StringVersionControlPairs;
if (inputDirectory.isEmpty())
if (inputDirectory.isEmpty()) {
if (topLevelDirectory)
topLevelDirectory->clear();
return 0;
}
// Make sure we an absolute path:
const QString directory = QDir(inputDirectory).absolutePath();