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
F19504699: D20786.diff
Fri, Jan 9, 6:11 AM
F19498906: D20786.diff
Thu, Jan 8, 1:21 PM
F19107514: D20786.diff
Dec 8 2025, 4:50 AM
F19070421: D20786.id.diff
Nov 30 2025, 4:51 PM
F19059212: D20786.diff
Nov 29 2025, 4:50 AM
F18835567: D20786.id.diff
Oct 26 2025, 4:55 PM
F18830193: D20786.diff
Oct 25 2025, 4:54 AM
F18818568: D20786.diff
Oct 22 2025, 1:06 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