public function testRemoteBranchParser()
    {
        $output = <<<EOTXT
  origin/HEAD           -> origin/master
  origin/accent-folding bfaea2e72197506e028c604cd1a294b6e37aa17d Add...
  origin/eventordering  185a90a3c1b0556015e5f318fb86ccf8f7a6f3e3 RFC: Order...
  origin/master         713f1fc54f9cfc830acbf6bbdb46a2883f772896 Automat...
  alternate/stuff       4444444444444444444444444444444444444444 Hmm...
origin/HEAD 713f1fc54f9cfc830acbf6bbdb46a2883f772896
origin/weekend-refactoring 6e947ab0498b82075ca6195ac168385a11326c4b
alternate/release-1.0.0 9ddd5d67962dd89fa167f9989954468b6c517b87

EOTXT;
        $this->assertEqual(array('origin/accent-folding' => 'bfaea2e72197506e028c604cd1a294b6e37aa17d', 'origin/eventordering' => '185a90a3c1b0556015e5f318fb86ccf8f7a6f3e3', 'origin/master' => '713f1fc54f9cfc830acbf6bbdb46a2883f772896', 'alternate/stuff' => '4444444444444444444444444444444444444444', 'origin/weekend-refactoring' => '6e947ab0498b82075ca6195ac168385a11326c4b', 'alternate/release-1.0.0' => '9ddd5d67962dd89fa167f9989954468b6c517b87'), DiffusionGitBranch::parseRemoteBranchOutput($output));
        $this->assertEqual(array('accent-folding' => 'bfaea2e72197506e028c604cd1a294b6e37aa17d', 'eventordering' => '185a90a3c1b0556015e5f318fb86ccf8f7a6f3e3', 'master' => '713f1fc54f9cfc830acbf6bbdb46a2883f772896', 'weekend-refactoring' => '6e947ab0498b82075ca6195ac168385a11326c4b'), DiffusionGitBranch::parseRemoteBranchOutput($output, 'origin'));
    }
 protected function getGitResult(ConduitAPIRequest $request)
 {
     $drequest = $this->getDiffusionRequest();
     $repository = $drequest->getRepository();
     $contains = $request->getValue('contains');
     if (strlen($contains)) {
         // NOTE: We can't use DiffusionLowLevelGitRefQuery here because
         // `git for-each-ref` does not support `--contains`.
         if ($repository->isWorkingCopyBare()) {
             list($stdout) = $repository->execxLocalCommand('branch --verbose --no-abbrev --contains %s --', $contains);
             $ref_map = DiffusionGitBranch::parseLocalBranchOutput($stdout);
         } else {
             list($stdout) = $repository->execxLocalCommand('branch -r --verbose --no-abbrev --contains %s --', $contains);
             $ref_map = DiffusionGitBranch::parseRemoteBranchOutput($stdout, DiffusionGitBranch::DEFAULT_GIT_REMOTE);
         }
         $refs = array();
         foreach ($ref_map as $ref => $commit) {
             $refs[] = id(new DiffusionRepositoryRef())->setShortName($ref)->setCommitIdentifier($commit);
         }
     } else {
         $refs = id(new DiffusionLowLevelGitRefQuery())->setRepository($repository)->withIsOriginBranch(true)->execute();
     }
     return $this->processBranchRefs($request, $refs);
 }