diff --git a/src/Composer/Command/DiagnoseCommand.php b/src/Composer/Command/DiagnoseCommand.php index 97ecf1c6b..bdaa4d567 100644 --- a/src/Composer/Command/DiagnoseCommand.php +++ b/src/Composer/Command/DiagnoseCommand.php @@ -238,14 +238,14 @@ EOT } $gitVersion = Git::getVersion($this->process); - if (version_compare('2.24.0', $gitVersion, '>')) { - return 'Your git version ('.$gitVersion.') is too old and possibly will cause issues. Please upgrade to git 2.24 or above'; - } - if (null === $gitVersion) { return 'No git process found'; } + if (version_compare('2.24.0', $gitVersion, '>')) { + return 'Your git version ('.$gitVersion.') is too old and possibly will cause issues. Please upgrade to git 2.24 or above'; + } + return 'OK git version '.$gitVersion.''; } diff --git a/tests/Composer/Test/Command/DiagnoseCommandTest.php b/tests/Composer/Test/Command/DiagnoseCommandTest.php index 0f071ef5c..5ca670265 100644 --- a/tests/Composer/Test/Command/DiagnoseCommandTest.php +++ b/tests/Composer/Test/Command/DiagnoseCommandTest.php @@ -29,8 +29,7 @@ class DiagnoseCommandTest extends TestCase $this->assertStringContainsString('Checking composer.json: WARNING No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.', $output); - $this->assertStringContainsString('Checking git settings: OK -Checking http connectivity to packagist: OK + $this->assertStringContainsString('Checking http connectivity to packagist: OK Checking https connectivity to packagist: OK Checking github.com rate limit: ', $output); } @@ -47,8 +46,7 @@ Checking github.com rate limit: ', $output); $output = $appTester->getDisplay(true); $this->assertStringContainsString('Checking composer.json: OK', $output); - $this->assertStringContainsString('Checking git settings: OK -Checking http connectivity to packagist: OK + $this->assertStringContainsString('Checking http connectivity to packagist: OK Checking https connectivity to packagist: OK Checking github.com rate limit: ', $output); }