Page MenuHomePhabricator

In "arc land", when "remote/onto" does not exist locally, try to fetch it before giving up
ClosedPublic

Authored by epriestley on Oct 28 2019, 6:20 PM.
Tags
None
Referenced Files
F12815032: D20870.diff
Thu, Mar 28, 2:31 AM
Unknown Object (File)
Sun, Mar 10, 8:16 AM
Unknown Object (File)
Feb 21 2024, 8:09 PM
Unknown Object (File)
Feb 9 2024, 2:44 PM
Unknown Object (File)
Feb 3 2024, 11:21 PM
Unknown Object (File)
Jan 25 2024, 2:09 AM
Unknown Object (File)
Jan 16 2024, 4:48 AM
Unknown Object (File)
Jan 8 2024, 4:25 PM
Subscribers
None

Details

Summary

Fixes T10650. It's valid to arc land --remote origin --onto master without first fetching that ref. If we can't find a local ref for a specified remote branch, try to fetch it before giving up.

(In the long run, this should be valid even if the remote branch does not exist at all and the user intends to create it -- see T12876 -- but this is a step toward that.)

Test Plan
  • Ran rm .git/refs/remotes/origin/master, then landed into "master".
  • Before: "arc land" bailed out immediately.
  • After: "arc land" fetches the missing ref.
$ arc land
 TARGET  Landing onto "master", the default target under git.
 REMOTE  Using remote "origin", the default remote under Git.
 TARGET  No local ref exists for branch "master" in remote "origin", attempting fetch...
 FETCHED  Fetched branch "master" from remote "origin".
...

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Oct 28 2019, 6:31 PM
This revision was automatically updated to reflect the committed changes.