freepbx::out("HTTP Mode is only supported with GIT 1.7.9 or Higher"); die; } elseif ($mode == 'http') { Git::enable_credential_cache(); } if (isset($options['r'])) { $stash->project_key = $project; $repo = $stash->getRepo($options['r']); if ($repo === false) { freepbx::out("[ERROR] Unable to find " . $options['m']); exit(0); } } else { $stash = new Stash($username, $password); foreach ($projects as $project => $description) { $repo = $stash->getRepo($options['m'], $project); if ($repo === false) { freepbx::out("[WARN] " . $options['m'] . " is NOT in the " . $description); } else { break; } } if ($repo === false) { freepbx::out("[ERROR] Unable to find " . $options['m']); exit(0); } $uri = $mode == 'http' ? $repo['cloneUrl'] : $repo['cloneSSH']; $dir = $directory . '/' . $options['m']; freepbx::out("Cloning " . $repo['name'] . " into " . $dir); $repo = Git::create($dir, $uri); $repo->add_merge_driver();
die; } elseif ($mode == 'http') { Git::enable_credential_cache(); } if (isset($options['r'])) { $stash->project_key = $project; $repo = $stash->getRepo($options['r']); if ($repo === false) { freepbx::out("[ERROR] Unable to find " . $options['m']); exit(0); } } else { $stash = new Stash($username, $password); foreach ($projects as $project => $description) { $stash->project_key = $project; $repo = $stash->getRepo($options['m']); if ($repo === false) { freepbx::out("[WARN] " . $options['m'] . " is NOT in the " . $description); } else { break; } } if ($repo === false) { freepbx::out("[ERROR] Unable to find " . $options['m']); exit(0); } $uri = $mode == 'http' ? $repo['cloneUrl'] : $repo['cloneSSH']; $dir = $directory . '/' . $options['m']; freepbx::out("Cloning " . $repo['name'] . " into " . $dir); $repo = Git::create($dir, $uri); $repo->add_merge_driver();