Revert "fix: replace deprecated :* with modern * wildcard in git permissions (#929)" (#949)

This reverts commit 1bb0e7464b934392210ba86f06bec55297259d82.
This commit is contained in:
Ashwin Bhat 2026-02-15 14:39:25 -08:00 committed by GitHub
parent f5088835af
commit 68cfeead18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 27 additions and 27 deletions

View File

@ -57,13 +57,13 @@ export function buildAllowedToolsString(
} else { } else {
// When not using commit signing, add specific Bash git commands // When not using commit signing, add specific Bash git commands
baseTools.push( baseTools.push(
"Bash(git add *)", "Bash(git add:*)",
"Bash(git commit *)", "Bash(git commit:*)",
"Bash(git push *)", "Bash(git push:*)",
"Bash(git status *)", "Bash(git status:*)",
"Bash(git diff *)", "Bash(git diff:*)",
"Bash(git log *)", "Bash(git log:*)",
"Bash(git rm *)", "Bash(git rm:*)",
); );
} }

View File

@ -135,13 +135,13 @@ export async function prepareTagMode({
// SSH signing still uses git CLI, just with signing enabled // SSH signing still uses git CLI, just with signing enabled
if (!useApiCommitSigning) { if (!useApiCommitSigning) {
tagModeTools.push( tagModeTools.push(
"Bash(git add *)", "Bash(git add:*)",
"Bash(git commit *)", "Bash(git commit:*)",
"Bash(git push *)", "Bash(git push:*)",
"Bash(git status *)", "Bash(git status:*)",
"Bash(git diff *)", "Bash(git diff:*)",
"Bash(git log *)", "Bash(git log:*)",
"Bash(git rm *)", "Bash(git rm:*)",
); );
} else { } else {
// When using API commit signing, use MCP file ops tools // When using API commit signing, use MCP file ops tools

View File

@ -894,9 +894,9 @@ describe("buildAllowedToolsString", () => {
expect(result).toContain("Write"); expect(result).toContain("Write");
// Default is no commit signing, so should have specific Bash git commands // Default is no commit signing, so should have specific Bash git commands
expect(result).toContain("Bash(git add *)"); expect(result).toContain("Bash(git add:*)");
expect(result).toContain("Bash(git commit *)"); expect(result).toContain("Bash(git commit:*)");
expect(result).toContain("Bash(git push *)"); expect(result).toContain("Bash(git push:*)");
expect(result).toContain("mcp__github_comment__update_claude_comment"); expect(result).toContain("mcp__github_comment__update_claude_comment");
// Should not have commit signing tools // Should not have commit signing tools
@ -916,8 +916,8 @@ describe("buildAllowedToolsString", () => {
expect(result).toContain("Write"); expect(result).toContain("Write");
// Should have specific Bash git commands for non-signing mode // Should have specific Bash git commands for non-signing mode
expect(result).toContain("Bash(git add *)"); expect(result).toContain("Bash(git add:*)");
expect(result).toContain("Bash(git commit *)"); expect(result).toContain("Bash(git commit:*)");
expect(result).toContain("mcp__github_comment__update_claude_comment"); expect(result).toContain("mcp__github_comment__update_claude_comment");
// Should not have commit signing tools // Should not have commit signing tools
@ -1009,13 +1009,13 @@ describe("buildAllowedToolsString", () => {
expect(result).toContain("Write"); expect(result).toContain("Write");
// Specific Bash git commands should be included // Specific Bash git commands should be included
expect(result).toContain("Bash(git add *)"); expect(result).toContain("Bash(git add:*)");
expect(result).toContain("Bash(git commit *)"); expect(result).toContain("Bash(git commit:*)");
expect(result).toContain("Bash(git push *)"); expect(result).toContain("Bash(git push:*)");
expect(result).toContain("Bash(git status *)"); expect(result).toContain("Bash(git status:*)");
expect(result).toContain("Bash(git diff *)"); expect(result).toContain("Bash(git diff:*)");
expect(result).toContain("Bash(git log *)"); expect(result).toContain("Bash(git log:*)");
expect(result).toContain("Bash(git rm *)"); expect(result).toContain("Bash(git rm:*)");
// Comment tool from minimal server should be included // Comment tool from minimal server should be included
expect(result).toContain("mcp__github_comment__update_claude_comment"); expect(result).toContain("mcp__github_comment__update_claude_comment");
@ -1031,7 +1031,7 @@ describe("buildAllowedToolsString", () => {
// Base tools should be present // Base tools should be present
expect(result).toContain("Edit"); expect(result).toContain("Edit");
expect(result).toContain("Bash(git add *)"); expect(result).toContain("Bash(git add:*)");
// Custom tools should be included // Custom tools should be included
expect(result).toContain("CustomTool1"); expect(result).toContain("CustomTool1");