@ -77,6 +77,7 @@ class GitDownloader extends VcsDownloader
*/
public function getLocalChanges($path)
{
$this->cleanEnv();
$path = $this->normalizePath($path);
if (!is_dir($path.'/.git')) {
return;
@ -95,6 +96,7 @@ class GitDownloader extends VcsDownloader
protected function cleanChanges($path, $update)
if (!$changes = $this->getLocalChanges($path)) {
@ -26,10 +26,16 @@ class Git
}
// added in git 1.7.1, prevents prompting the user for username/password
putenv('GIT_ASKPASS=echo');
if (getenv('GIT_ASKPASS') !== 'echo') {
// clean up rogue git env vars in case this is running in a git hook
putenv('GIT_DIR');
putenv('GIT_WORK_TREE');
if (getenv('GIT_DIR')) {
if (getenv('GIT_WORK_TREE')) {