CliArgs::REQUIRED|CliArgs::SINGLE|CliArgs::REQARG],
["g", "git", "Use `git ls-tree` to determine file list",
CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG],
+ ["b", "branch", "Checkout this tag/branch",
+ CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG],
["p", "pecl", "Use PECL package.xml to determine file list, name and release",
CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG],
["d", "dest", "Destination directory",
*/
private function download($source) {
if ($this->args->git) {
- $task = new Task\GitClone($source);
+ $task = new Task\GitClone($source, $this->args->branch);
} else {
/* print newline only once */
$done = false;
* @return string local source directory
*/
private function localize($source) {
- if (!stream_is_local($source)) {
+ if (!stream_is_local($source) || ($this->args->git && isset($this->args->branch))) {
$source = $this->download($source);
$this->cleanup[] = new Task\Cleanup($source);
}