From 495356ce9d900ce969768bbd48ec8dcdde2124f3 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Sun, 29 Jul 2018 21:51:43 +0200 Subject: [PATCH] Git: Fix remote detection for local remotes starting with "file://" Task-number: QTCREATORBUG-20618 Change-Id: I21cddf88b64fa7a6acdc92228142976284ef8942 Reviewed-by: Orgad Shaneh --- src/plugins/git/gitclient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index e2fa7fe8d53..5797619b4e1 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -3371,10 +3371,10 @@ GitRemote::GitRemote(const QString &url) // Check for local remotes (refer to the root or relative path) // On Windows, local paths typically starts with : - if (url.startsWith('/') || url.startsWith('.') + if (url.startsWith("file://") || url.startsWith('/') || url.startsWith('.') || (HostOsInfo::isWindowsHost() && url[1] == ':')) { protocol = "file"; - path = QDir::fromNativeSeparators(url); + path = QDir::fromNativeSeparators(url.startsWith("file://") ? url.mid(7) : url); isValid = QDir(path).exists() || QDir(path + ".git").exists(); return; }