Page MenuHomePhabricator

When running "arc land" from a detached HEAD, don't try to delete the source ref
ClosedPublic

Authored by epriestley on Sep 5 2019, 12:25 PM.

Details

Summary

Fixes T10321. Some reasonable but less-common workflows involve running arc land from a detached HEAD state.

When users do this, we currently try to delete the raw hash as though it were a branch during cleanup. Instead, detect if the thing we're thinking about deleting is a branch or not, and just leave it alone if it isn't.

Test Plan
  • Ran git checkout <some hash>, then arc land --revision <some revision>.
  • Before, everything worked but cleanup tried to git branch -D <some hash>.
  • After, everything worked and cleanup skipped branch deletion.

Diff Detail

Repository
rARC Arcanist
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Sep 5 2019, 12:25 PM
epriestley requested review of this revision.Sep 5 2019, 12:25 PM
This revision was not accepted when it landed; it landed in state Needs Review.Sep 5 2019, 12:31 PM
This revision was automatically updated to reflect the committed changes.
leoluk awarded a token.Sep 6 2019, 8:42 AM