Skip to content

fix(settings): restore git -c and git switch force guards - #3

Merged
JustinasLa merged 1 commit into
mainfrom
fix/deny-list-guards
Sep 10, 2026
Merged

JustinasLa merged 1 commit into
mainfrom
fix/deny-list-guards

Conversation

@JustinasLa

Copy link
Copy Markdown
Contributor

An automated security review flagged two deny-list entries dropped in #2. Both flags are valid.

What was wrong

Bash(git -c*) and Bash(git switch --discard-changes*) / Bash(git switch -f*) were removed in #2 on the belief that git -c* was also blocking git switch -c <branch>, which the agent needs for normal branch creation.

That diagnosis was wrong. The block came from the old blanket Bash(git switch*) entry on main, which briefly came back into effect when a --delete-branch checkout swapped the working tree back to main. Verified by restoring the entries and running both commands: git switch main and git switch -c probe-delete-me each succeed with Bash(git -c*) in place.

What this restores

  • Bash(git -c*) — git -c key=value <cmd> can override config to route around the other rules.
  • Bash(git switch --discard-changes*), Bash(git switch -f*), Bash(git switch --force*) — these destroy uncommitted work exactly as the already-denied checkout, restore, and clean do.

Deny list goes from 33 to 37 entries. Nothing else changes.

git -c key=value can override config to route around the other rules,
and git switch --discard-changes / -f destroy uncommitted work the same
way the already-denied checkout, restore and clean do.

These were dropped on the mistaken belief that git -c* also blocked
git switch -c. Verified it does not: the earlier block came from the
old blanket git switch* entry.
@JustinasLa
JustinasLa merged commit d1e1deb into main Sep 10, 2026
1 check passed
@JustinasLa
JustinasLa deleted the fix/deny-list-guards branch September 10, 2026 18:45
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.

1 participant