git: respect repository commit.gpgsign=false when commit signing is enabled

This commit is contained in:
dualfroz committed 2026-10-13 23:05:12 +02:00
1 parent 933ad74eab
commit 0b097f6ad9
1 file changed
+9 -3
+9 -3
View File
@@ -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<boolean>('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<boolean>('enableCommitSigning') === true) {
const commitGpgSign = await repository.getConfig('commit.gpgsign');
opts.signCommit = /^(false|no|off|0)$/i.test(commitGpgSign) ? undefined : true;
}
if (config.get<boolean>('alwaysSignOff')) {
opts.signoff = true;