From 10c94c5ba42460bef424a93b380608ea601c52df Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 18 Dec 2011 20:32:26 +0100 Subject: [PATCH] Workaround for checking out branch whose names are missing the origin/ prefix --- src/Composer/Downloader/GitDownloader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php index 6cb3f3f14..c22f323ce 100644 --- a/src/Composer/Downloader/GitDownloader.php +++ b/src/Composer/Downloader/GitDownloader.php @@ -38,7 +38,7 @@ class GitDownloader implements DownloaderInterface $url = escapeshellarg($package->getSourceUrl()); $ref = escapeshellarg($package->getSourceReference()); - system(sprintf('git clone %s %s && cd %2$s && git reset --hard %s', $url, $path, $ref)); + system(sprintf('git clone %s %s && cd %2$s && git checkout %3$s && git reset --hard %3$s', $url, $path, $ref)); } /** @@ -51,7 +51,7 @@ class GitDownloader implements DownloaderInterface } $this->enforceCleanDirectory($path); - system(sprintf('cd %s && git fetch && git reset --hard %s', $path, $target->getSourceReference())); + system(sprintf('cd %s && git fetch && git checkout %2$s && git reset --hard %2$s', $path, $target->getSourceReference())); } /**