HomePhabricator

tighten remote URI error handling with idiosyncratic remote names

Authored by cburroughs on Dec 28 2016, 10:43 PM.

Description

tighten remote URI error handling with idiosyncratic remote names

Summary:
git ls-remote has an unusual way to indicate a URL was not
found: echoing back user input

$ git ls-remote --get-url does_not_exist
does_not_exist
$ echo $?
0

getRemoteURI handles checking for remotes other than 'origin', but
the error handling always matched against the string 'origin'
regardless of remote name.

Test Plan:
With a git config along the lines of:

[remote "my_special_name"]
        url = ssh://secure@secure.phabricator.com/diffusion/ARC/arcanist.git
        fetch = +refs/heads/*:refs/remotes/my_special_name/*
[branch "master"]
        remote = github
        merge = refs/heads/master
[remote "github"]
         # url = git@github.com:phacility/arcanist.git
         fetch = +refs/heads/*:refs/remotes/github/*

and running in a branch tracking master (github). arc which would
(without this diff) show:

The remote URI for this working copy is "github".

With this diff, arc which correctly shows:

Unable to determine the remote URI for this repository.

When diffing against a tracking branch with a propertly configured
remote (the happy path), arc which still correctly identifies the
remote URI:

The remote URI for this working copy is
"ssh://secure@secure.phabricator.com/diffusion/ARC/arcanist.git".

Reviewers: Blessed Reviewers, epriestley

Reviewed By: Blessed Reviewers, epriestley

Subscribers: Korvin, chad, epriestley

Differential Revision: https://secure.phabricator.com/D17110

Details

Committed
cburroughsDec 29 2016, 3:35 PM
Pushed
cburroughsDec 29 2016, 3:36 PM
Reviewer
Blessed Reviewers
Differential Revision
D17110: tighten remote URI error handling with idiosyncratic remote names
Parents
rARCfad85844314b: Make "aliases" show up in "arc get-config" help
Branches
Unknown
Tags
Unknown
Build Status
Buildable 15039
Build 19734: Run Core Tests