From e0141402c91323ef6f58ed07db0641b80dd29ca7 Mon Sep 17 00:00:00 2001 From: c33s Date: Mon, 14 Jan 2019 10:34:41 +0100 Subject: [PATCH] GitRepository: fixed isRemoteUrlReadable() on Windows --- src/GitRepository.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/GitRepository.php b/src/GitRepository.php index 2e82781..450217d 100644 --- a/src/GitRepository.php +++ b/src/GitRepository.php @@ -780,8 +780,17 @@ public static function cloneRepository($url, $directory = NULL, array $params = */ public static function isRemoteUrlReadable($url, array $refs = NULL) { + $env = ''; + + if (DIRECTORY_SEPARATOR === '\\') { // Windows + $env = 'set GIT_TERMINAL_PROMPT=0 &&'; + + } else { + $env = 'GIT_TERMINAL_PROMPT=0'; + } + exec(self::processCommand(array( - 'GIT_TERMINAL_PROMPT=0 git ls-remote', + $env . 'git ls-remote', '--heads', '--quiet', '--exit-code',