/** * Set up the git wrapper and the temporary directory. */ protected function setup() { // @TODO: Allow setting up in an existing dierectory. if (!$this->dir) { // Greate a temporary directory. $tempfile = tempnam(sys_get_temp_dir(), ''); mkdir($tempfile . '.git'); if (file_exists($tempfile)) { unlink($tempfile); } $this->dir = $tempfile . '.git'; $this->git = $this->wrapper->init($this->dir); } $this->git->config('user.name', 'GitMerge')->config('user.email', '*****@*****.**')->config('merge.conflictStyle', 'diff3'); $this->strategy = null; }
private function getGitWorking($gitWrapper, $package) { $git = new GitWorkingCopy($gitWrapper, $package->getFolder()); $git->config('user.name', $this->githubUserName)->config('user.email', $this->githubEmail); return $git; }