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.
Tags
None
Referenced Files
F15523845: D20786.diff
Mon, Apr 21, 4:03 AM
F15505276: D20786.id49563.diff
Tue, Apr 15, 1:31 AM
F15475149: D20786.id.diff
Sun, Apr 6, 4:34 PM
F15471471: D20786.diff
Sat, Apr 5, 5:14 AM
F15434452: D20786.diff
Mar 25 2025, 3:46 AM
F15406901: D20786.id49562.diff
Mar 18 2025, 2:36 PM
F15396807: D20786.id.diff
Mar 16 2025, 4:24 PM
F15370829: D20786.diff
Mar 12 2025, 10:16 AM
Subscribers
None
Tokens
"Party Time" token, awarded by leoluk.

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
Lint Not Applicable
Unit
Tests Not Applicable