Archived
Hard restore with X asks before dropping staged pins
X dropped staged pins without a question, including the selected submodule's own pin, which the loss check didn't count. A staged pin is a decision, and X sits one Shift away from x, so dropped staged pins now count as a loss and make X ask (D31, amends D30). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -135,13 +135,7 @@ func (m Model) lossChecked(msg lossMsg) (tea.Model, tea.Cmd) {
|
||||
m.restore.branch = msg.branch
|
||||
}
|
||||
m.restore.loss = msg.loss
|
||||
// a hard restore is asked for to drop staged pins: alone they are no
|
||||
// reason to ask, but are listed if something else is lost
|
||||
lost := msg.loss
|
||||
if m.restore.to == submodule.RestoreHard {
|
||||
lost.StagedPins, lost.Modules = 0, 0
|
||||
}
|
||||
if lost.Empty() {
|
||||
if msg.loss.Empty() {
|
||||
return m.runRestore()
|
||||
}
|
||||
m.restore.phase = restoreAsking
|
||||
|
||||
Reference in New Issue
Block a user