cli/overlay.sh: fix inverted yesno guard in __overlay_reset#54
cli/overlay.sh: fix inverted yesno guard in __overlay_reset#54Dev-X25874 wants to merge 1 commit into
Conversation
djkabutar
left a comment
There was a problem hiding this comment.
thanks for the PR, can you mention the fix in the commit message as well, it will be easier to track there. You can check previous commits for more reference.
|
Hey @djkabutar, done! Updated the commit message to follow the project's convention. Let me know if anything else needs changing. |
|
you have made the changes but, you have created extra commit on top of the other commits & which is empty commit, which is not required, you need to rebase and reword the commits and force push it in order to reflect properly |
2f4245f to
a38350f
Compare
|
@djkabutar done! Squashed all 3 commits into 1 clean commit. Let me know if anything else needs changing. |
|
@djkabutar sorry for the confusion earlier with the extra commits. Should be clean now — let me know if anything else needs fixing. |
Problem
__overlay_resetincli/overlay.shhad an inverted confirmation guard.yesno_clireturns 0 when the user types "yes" and 1 when they type"no". The existing code used:
This means a user confirming the reset ("yes") would silently abort,
while a user declining ("no") would trigger the destructive
reset_overlayscall — the exact opposite of intent.The TUI counterpart (
tui/overlay/overlay.sh) and__overlay_installin the same file both correctly use
if ! yesno_clias the abortguard.
Fix
Add the missing
!on line 261:Test
Added
cli/test/overlay_reset_test.shwhich stubs all externaldependencies and asserts:
reset_overlaysexactly oncereset_overlays