Homec4science

Fix git "origin" remote in more circumstances

Authored by epriestley <git@epriestley.com> on Nov 20 2013, 19:41.

Description

Fix git "origin" remote in more circumstances

Summary:
Fixes T4041. We currently detect when "origin" is incorrect, but can do better:

  • When "origin" is missing, we can add it. This happens for Git 1.7.1 -- see T4041.
  • When "origin" is wrong, we can fix it automatically if we control the repository.

We only need to fail when origin exists, is wrong, and we aren't in charge of the repository.

Test Plan: Ran bin/repository discover X on a repository with a good origin, no origin, a bad-but-under-control origin, and a bad-out-of-control origin. Got the right behavior in all cases.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, champo

Maniphest Tasks: T4041

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

Details

Committed
epriestley <git@epriestley.com>Nov 20 2013, 19:41
Pushed
aubortJan 31 2017, 17:16
Parents
rPHff8b48979eb7: Simplify Repository remote and local command construction
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHa07f444f2a5e: Fix git "origin" remote in more circumstances (authored by epriestley <git@epriestley.com>).Nov 20 2013, 19:41