From 47aa87ea971cdbcac06e4bb9dce4ae60aa7779de Mon Sep 17 00:00:00 2001 From: Rob Bast Date: Tue, 2 Feb 2016 10:26:43 +0100 Subject: [PATCH] use full json content to determine reference, closes #4859 --- src/Composer/Repository/PathRepository.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Composer/Repository/PathRepository.php b/src/Composer/Repository/PathRepository.php index c3266543b..7fa004eb5 100644 --- a/src/Composer/Repository/PathRepository.php +++ b/src/Composer/Repository/PathRepository.php @@ -125,17 +125,16 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn $package['dist'] = array( 'type' => 'path', 'url' => $url, - 'reference' => '', + 'reference' => sha1($json), ); if (!isset($package['version'])) { $package['version'] = $this->versionGuesser->guessVersion($package, $path) ?: 'dev-master'; } + $output = ''; if (is_dir($path . DIRECTORY_SEPARATOR . '.git') && 0 === $this->process->execute('git log -n1 --pretty=%H', $output, $path)) { $package['dist']['reference'] = trim($output); - } else { - $package['dist']['reference'] = Locker::getContentHash($json); } $package = $this->loader->load($package);