From a1b468ea504427e9f071999bd2cf63a8ecb757d5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 11 Dec 2016 17:04:24 +0100 Subject: [PATCH] Fix git shortening, it is sunday.. --- src/Composer/Downloader/GitDownloader.php | 2 +- .../Test/Fixtures/functional/create-project-command.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php index e3e751f46..748016f92 100644 --- a/src/Composer/Downloader/GitDownloader.php +++ b/src/Composer/Downloader/GitDownloader.php @@ -496,7 +496,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface protected function getShortHash($reference) { if (!$this->io->isVerbose() && preg_match('{^[0-9a-f]{40}$}', $reference)) { - return substr($reference, 10); + return substr($reference, 0, 10); } return $reference; diff --git a/tests/Composer/Test/Fixtures/functional/create-project-command.test b/tests/Composer/Test/Fixtures/functional/create-project-command.test index d6ce7b077..1f2f36f1e 100644 --- a/tests/Composer/Test/Fixtures/functional/create-project-command.test +++ b/tests/Composer/Test/Fixtures/functional/create-project-command.test @@ -2,7 +2,7 @@ create-project seld/jsonlint %testDir% 1.0.0 --prefer-source -n --EXPECT-ERROR-- Installing seld/jsonlint (1.0.0) - - Installing seld/jsonlint (1.0.0) Cloning 3b4bc2a96ff5d3fe6866bfe9dd0c845246705791 + - Installing seld/jsonlint (1.0.0) Cloning 3b4bc2a96f Created project in %testDir% Loading composer repositories with package information Updating dependencies (including require-dev)