Commit d567c600 authored by Petar Perisin's avatar Petar Perisin
Browse files

Git - bugfix with empty string in findRepositoryForDirectory

Change-Id: I44f68ad59d10e9751d09ed6e0f959d2a78d53822
Reviewed-by: default avatarTobias Hunger <>
Reviewed-by: default avatarOrgad Shaneh <>
parent df4353de
......@@ -760,8 +760,10 @@ const char *GitClient::decorateOption = "--decorate";
QString GitClient::findRepositoryForDirectory(const QString &dir)
if (dir.endsWith(QLatin1String("/.git")) || dir.contains(QLatin1String("/.git/")))
if (dir.isEmpty() || dir.endsWith(QLatin1String("/.git"))
|| dir.contains(QLatin1String("/.git/"))) {
return QString();
QDir directory(dir);
QString dotGit = QLatin1String(GIT_DIRECTORY);
// QFileInfo is outside loop, because it is faster this way
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment