Skip to content

Commit

Permalink
GitRepository: fixed isRemoteUrlReadable() on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
c33s authored and janpecha committed Jan 14, 2019
1 parent a1398bd commit e014140
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/GitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit e014140

Please sign in to comment.