forked from qt-creator/qt-creator
VCS[git/hg]: Prevent search for repository from creating folders
... when autofs is involved. Check for files instead of folders and stop checking/recursing up at '/' or $HOME. Further fixup will follow. Task-number: QTCREATORBUG-1361 Task-number: QTBUG-10495
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||
#include <vcsbase/vcsbaseplugin.h>
|
||||
|
||||
#include <projectexplorer/environment.h>
|
||||
|
||||
@@ -155,13 +156,9 @@ const char *GitClient::noColorOption = "--no-color";
|
||||
|
||||
QString GitClient::findRepositoryForDirectory(const QString &dir)
|
||||
{
|
||||
const QString gitDirectory = QLatin1String(kGitDirectoryC);
|
||||
QDir directory(dir);
|
||||
do {
|
||||
if (QFileInfo(directory, gitDirectory).isDir())
|
||||
return directory.absolutePath();
|
||||
} while (directory.cdUp());
|
||||
return QString();
|
||||
// Check for ".git/config"
|
||||
const QString checkFile = QLatin1String(kGitDirectoryC) + QLatin1String("/config");
|
||||
return VCSBase::VCSBasePlugin::findRepositoryForDirectory(dir, checkFile);
|
||||
}
|
||||
|
||||
/* Create an editor associated to VCS output of a source file/directory
|
||||
|
||||
Reference in New Issue
Block a user