Skip to content

Git - warn that changes will be LOST when force deleting worktree#307879

Open
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:fix/worktree-delete-lost-changes-warning
Open

Git - warn that changes will be LOST when force deleting worktree#307879
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:fix/worktree-delete-lost-changes-warning

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

What does this PR do?

Make the force-delete confirmation for a worktree with modified or untracked files explicit about data loss.

Fixes #286100

Current behavior

When attempting to delete a worktree that contains modified or untracked files, the user sees:

The worktree contains modified or untracked files. Do you want to force delete?

This does not clearly communicate that the user's uncommitted work will be permanently lost if they proceed.

New behavior

The dialog now includes an explicit detail message, matching the IRREVERSIBLE / FOREVER LOST language already used in the discard-changes flow (_cleanTrackedChanges / getDiscardUntrackedChangesDialogDetails in extensions/git/src/commands.ts):

The worktree contains modified or untracked files. Do you want to force delete?

This is IRREVERSIBLE!
Your changes will be FOREVER LOST if you proceed.

Notes

  • Localized via l10n.t.
  • Single file touched: extensions/git/src/repository.ts.
  • No behavior change beyond the updated copy on the modal warning.

Make the force-delete confirmation for a worktree with modified or
untracked files explicit about data loss, matching the existing
'IRREVERSIBLE / FOREVER LOST' language used for discard changes.

Fixes microsoft#286100
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@lszomoru

Matched files:

  • extensions/git/src/repository.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Be more explicit about loosing uncommitted changes when deleting a worktree

2 participants