-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Adds an option to delete a worktree along with its branch (GLVSC-637) #3508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ae0dbe8
to
572ef21
Compare
572ef21
to
7a5d919
Compare
src/commands/git/worktree.ts
Outdated
const branchesOfDeletedWorktrees = yield* this.deleteCommandSteps( | ||
state as DeleteStepState, | ||
context, | ||
); | ||
if (branchesOfDeletedWorktrees !== StepResultBreak && branchesOfDeletedWorktrees?.length) { | ||
yield* getSteps( | ||
this.container, | ||
{ | ||
command: 'branch', | ||
state: { | ||
subcommand: 'delete', | ||
repo: state.repo, | ||
references: branchesOfDeletedWorktrees, | ||
}, | ||
}, | ||
this.pickedVia, | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move this into this.deleteCommandSteps
? I tried it locally and it seems fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have much context into this, and I'm not sure how many ways it can break, so I was only able to test easy/happy flows.
I think this is fine as it stands, but in the future, I think we can improve it by waiting to complete any action until all choices are made. I.e. if I choose "delete worktree and branch", do not delete the worktree until I have confirmed my "delete branch" choice in the next step.
@sergeibbb You have conflicts in the CHANGELOG file. Once those are addressed we can merge. |
7a5d919
to
c029552
Compare
- Avoids potential issues with backing up steps
Description
Adds 2 new options to delete the branch as part of the worktree delete.
Which will after the completion of the worktree(s) delete, will start the delete branch(es) flow (at it confirmation step – which will naturally happen if all the context is provided to that flow)
Checklist
Fixes $XXX -
orCloses #XXX -
prefix to auto-close the issue that your PR addresses