From 64240115db5d324fed9b6f63650e6af66074843a Mon Sep 17 00:00:00 2001 From: Peter Evans <18365890+peter-evans@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:59:11 +0000 Subject: [PATCH] fix: use --fixed-value flag when unsetting git config values The tryConfigUnsetValue method was passing file paths directly to `git config --unset`, which treats the value argument as an extended regular expression. File paths contain `.` characters that would match any character instead of literal periods, potentially causing incorrect matches. Adding the --fixed-value flag ensures the value is treated as a literal string, fixing credential config cleanup in the v6-style authentication. --- dist/index.js | 4 +++- src/git-command-manager.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index f1684e5..6dc7025 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 44d0177..b0ed1ae 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 }