diff --git a/dist/index.js b/dist/index.js index f1684e5c..6dc7025f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -979,7 +979,9 @@ class GitCommandManager { else { args.push(globalConfig ? '--global' : '--local'); } - args.push('--unset', configKey, configValue); + // Use --fixed-value to treat configValue as a literal string, not a regex pattern. + // This is important for file paths which contain regex special characters like '.' + args.push('--fixed-value', '--unset', configKey, configValue); const output = yield this.exec(args, { allowAllExitCodes: true }); return output.exitCode === 0; }); diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 44d0177e..b0ed1aef 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -368,7 +368,7 @@ export class GitCommandManager { } else { args.push(globalConfig ? '--global' : '--local') } - args.push('--unset', configKey, configValue) + args.push('--fixed-value', '--unset', configKey, configValue) const output = await this.exec(args, {allowAllExitCodes: true}) return output.exitCode === 0 }