1
0
Fork 0

use full json content to determine reference, closes #4859

pull/4863/head
Rob Bast 2016-02-02 10:26:43 +01:00
parent cff35071b6
commit 47aa87ea97
1 changed files with 2 additions and 3 deletions

View File

@ -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);