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
F18673308: D20786.id49563.diff
Thu, Sep 25, 10:09 AM
F18665120: D20786.diff
Wed, Sep 24, 12:44 AM
F18601548: D20786.diff
Sat, Sep 13, 12:48 PM
F18601457: D20786.diff
Sat, Sep 13, 12:34 PM
F18601455: D20786.diff
Sat, Sep 13, 12:33 PM
F18366172: D20786.id49563.diff
Aug 27 2025, 9:58 PM
F18363505: D20786.id49563.diff
Aug 27 2025, 4:43 PM
F18325966: D20786.id49563.diff
Aug 24 2025, 9:04 PM
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
Branch
dhead1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 23388
Build 32129: Run Core Tests
Build 32128: arc lint + arc unit