From: slawekbiel Date: Thu, 23 Jun 2011 20:28:37 +0000 (-0700) Subject: Quote branche names in arc branch X-Git-Tag: conduit-4~303 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=499d4bd24327fcdc81ce59d086107c50b9fbe675;p=arcanist.git Quote branche names in arc branch Summary: Turns out you can hava a branch named |foo. (Good that '&& rm -fR /usr' is not a valid name) Test Plan: created a branch |test, run arc branch Reviewed By: epriestley Reviewers: epriestley, dschafer CC: aran, epriestley, slawekbiel Revert Plan: sure Other Notes: Differential Revision: 507 --- diff --git a/src/repository/api/git/ArcanistGitAPI.php b/src/repository/api/git/ArcanistGitAPI.php index b07bc268..3c466b0d 100644 --- a/src/repository/api/git/ArcanistGitAPI.php +++ b/src/repository/api/git/ArcanistGitAPI.php @@ -417,12 +417,12 @@ class ArcanistGitAPI extends ArcanistRepositoryAPI { $result[] = $branch; } $all_names = ipull($result, 'name'); - $names_list = implode(' ', $all_names); // Calling 'git branch' first and then 'git rev-parse' is way faster than // 'git branch -v' for some reason. list($sha1s_string) = execx( - "cd %s && git rev-parse $names_list", - $this->path); + "cd %s && git rev-parse %Ls", + $this->path, + $all_names); $sha1_map = array_combine($all_names, explode("\n", trim($sha1s_string))); foreach ($result as &$branch) { $branch['sha1'] = $sha1_map[$branch['name']]; @@ -430,14 +430,6 @@ class ArcanistGitAPI extends ArcanistRepositoryAPI { return $result; } - public function multigetRevForBranch($branch_names) { - $names_list = implode(' ', $branch_names); - list($sha1s_string) = execx( - "cd %s && git rev-parse $names_list", - $this->path); - return array_combine($branch_names, explode("\n", trim($sha1s_string))); - } - /** * Returns git commit messages for the given revisions, * in the specified format (see git show --help for options).