r3bl-open-core
r3bl-open-core copied to clipboard
[giti] `giti branch delete`: Handle user trying to delete all the branches
Prerequisites
Install and run giti
- Move to
./tuify
folder in your terminal - Run
nu run.nu install-giti
to installgiti
locally to~/.cargo/bin
- Run
giti
from anywhere on your system - To delete one or more branches in your repo run
giti branch delete
Task
If a user tries to delete all branches (no branch left to switch to), show an error message displaying that the user is trying to delete all branches and there is no branch left to switch to and because of that, no branches were deleted.
> giti branch delete
Up or Down: navigation
Space: select or unselect branches
Return: confirm selection
Esc or Ctrl+C: exit program
Please select branches you want to delete
› ✔ Current: aaronsmith/branch-1
✔ main
✔ NadiaIdris/branch-2
✔ NadiaIdris/branch-3
✔ NadiaIdris/branch-4
------------------------------------------------------------------
(next step)
Up or Down: navigation
Space: select or unselect branches
Return: confirm selection
Esc or Ctrl+C: exit program
⚠️ You were trying to delete all your local branches!
⚠️ There was no branch to switch to, so no branches were deleted.
⚠️ Please leave one branch to switch to.