From 0b097f6ad9c388d9bc1a66832591bd9f0fc564aa Mon Sep 17 00:00:00 2001 From: DualFroz Date: Tue, 13 Oct 2026 23:05:12 +0200 Subject: [PATCH] git: respect repository commit.gpgsign=false when commit signing is enabled --- extensions/git/src/commands.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 52a752a..c710486 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -2458,9 +2458,15 @@ export class CommandCenter { } } - // Enable signing of commits if the setting is enabled. If the setting is not enabled, - // we set the option to undefined so that we let git use the repository/global config. - opts.signCommit = config.get('enableCommitSigning') === true ? true : undefined; + // Enable signing of commits if the setting is enabled, unless signing has been explicitly + // disabled in the repository config. Otherwise, we set the option to undefined so that we + // let git use the repository/global config. + opts.signCommit = undefined; + + if (config.get('enableCommitSigning') === true) { + const commitGpgSign = await repository.getConfig('commit.gpgsign'); + opts.signCommit = /^(false|no|off|0)$/i.test(commitGpgSign) ? undefined : true; + } if (config.get('alwaysSignOff')) { opts.signoff = true;