Clear up github env everywhere it is used
parent
81b2b84112
commit
52990eca1e
|
@ -21,6 +21,7 @@ use Composer\Repository\RepositoryManager;
|
|||
use Composer\Repository\Vcs\HgDriver;
|
||||
use Composer\IO\NullIO;
|
||||
use Composer\Util\ProcessExecutor;
|
||||
use Composer\Util\Git as GitUtil;
|
||||
|
||||
/**
|
||||
* ArrayLoader built for the sole purpose of loading the root package
|
||||
|
@ -182,6 +183,9 @@ class RootPackageLoader extends ArrayLoader
|
|||
|
||||
private function guessGitVersion(array $config)
|
||||
{
|
||||
$util = new GitUtil;
|
||||
$util->cleanEnv();
|
||||
|
||||
// try to fetch current version from git branch
|
||||
if (0 === $this->process->execute('git branch --no-color --no-abbrev -v', $output)) {
|
||||
$branches = array();
|
||||
|
|
|
@ -21,6 +21,7 @@ use Composer\Repository\ArrayRepository;
|
|||
use Composer\Package\Dumper\ArrayDumper;
|
||||
use Composer\Package\Loader\ArrayLoader;
|
||||
use Composer\Package\Version\VersionParser;
|
||||
use Composer\Util\Git as GitUtil;
|
||||
|
||||
/**
|
||||
* Reads/writes project lockfile (composer.lock).
|
||||
|
@ -324,6 +325,9 @@ class Locker
|
|||
|
||||
switch ($sourceType) {
|
||||
case 'git':
|
||||
$util = new GitUtil;
|
||||
$util->cleanEnv();
|
||||
|
||||
if (0 === $process->execute('git log -n1 --pretty=%ct '.escapeshellarg($sourceRef), $output, $path) && preg_match('{^\s*\d+\s*$}', $output)) {
|
||||
$datetime = new \DateTime('@'.trim($output), new \DateTimeZone('UTC'));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue