]> khamidou — GitHub mirrors - arcanist.git/commit
Avoid parsing git "remote show" using "ls-remote"
authorJavier Arteaga <code@jbeta.is>
Mon, 24 Aug 2015 11:51:03 +0000 (04:51 -0700)
committerepriestley <git@epriestley.com>
Mon, 24 Aug 2015 11:51:03 +0000 (04:51 -0700)
commit6ecb3fb87d2bce44a2d297a36b5880d8f384157e
tree94a4ea77ae3fcf972c697dc8093adcb895eff10e
parent9b8c9d280ea47e7256dd1ac0ff17fe4aa363477e
Avoid parsing git "remote show" using "ls-remote"

Summary:
Ref T5554. This makes git remote URL detection locale-agnostic.

The previously suggested `git config remote.origin.url` command does
almost the same, but does not support the URL rewriting features in
git-config (`url.<base>.insteadOf`).

This one does, although it has the unintuitive behavior of just printing
the passed remote name when the remote does not exist, or even when
called outside a git repo.

Test Plan:
* Switched to non-english locale in which git has a translation.
* Ran `arc which` on the Arcanist repo. It could not determine the remote URI.
* Applied patch, `arc which` found the URI.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: johnny-bit, Korvin

Maniphest Tasks: T5554

Differential Revision: https://secure.phabricator.com/D13983
src/repository/api/ArcanistGitAPI.php