diff --git a/plugins/git/gitplugin.cpp b/plugins/git/gitplugin.cpp --- a/plugins/git/gitplugin.cpp +++ b/plugins/git/gitplugin.cpp @@ -277,6 +277,9 @@ { QDir dir=dotGitDirectory(dirPath); QFile dotGitPotentialFile(dir.filePath(QStringLiteral(".git"))); + if (!dotGitPotentialFile.isLocalFile()) { + return false; + } // if .git is a file, we may be in a git worktree QFileInfo dotGitPotentialFileInfo(dotGitPotentialFile); if (!dotGitPotentialFileInfo.isDir() && dotGitPotentialFile.exists()) { @@ -294,7 +297,12 @@ return true; } } - return dir.exists(QStringLiteral(".git/HEAD")); + if (!dir.exists(QStringLiteral(".git/HEAD"))) { + return false; + } + // check if plugin should be disabled by reading git config + QString disabled = readConfigOption(dirPath, "kdevgit.disabled"); + return disabled.compare(QLatin1String("true"), Qt::CaseInsensitive) != 0; } bool GitPlugin::isValidRemoteRepositoryUrl(const QUrl& remoteLocation)