Skip to content

[ROSETTA] dangerous-actions git-branch-delete pattern misses force-delete flag variants #296

Description

@isolomatov-gd

The `git-branch-delete` pattern in `src/hooks/src/hooks/dangerous-actions/patterns.ts` (line 110) is `/\bgit\s+branch\s+-D\b/` — it only matches the literal uppercase combined flag `-D`. It misses equivalent force-delete forms like `git branch -d -f`, `git branch -fd`, and `git branch --delete --force`, all of which force-delete an unmerged branch just like `-D`.

Other destructive-pattern entries in the same file (`rm -rf`, `git push --force`) deliberately use permutation-tolerant matching for flag reordering/combination, but this one doesn't follow that convention. `src/hooks/tests/dangerous-actions.test.ts` (~lines 785-804) only tests the literal `-D` form. Where: `src/hooks/src/hooks/dangerous-actions/patterns.ts`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions