git: respect repository commit.gpgsign=false when commit signing is enabled
This commit is contained in:
1 parent
933ad74eab
commit
0b097f6ad9
1 file changed
+9
-3
@@ -2458,9 +2458,15 @@ export class CommandCenter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable signing of commits if the setting is enabled. If the setting is not enabled,
|
// Enable signing of commits if the setting is enabled, unless signing has been explicitly
|
||||||
// we set the option to undefined so that we let git use the repository/global config.
|
// disabled in the repository config. Otherwise, we set the option to undefined so that we
|
||||||
opts.signCommit = config.get<boolean>('enableCommitSigning') === true ? true : undefined;
|
// 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')) {
|
if (config.get<boolean>('alwaysSignOff')) {
|
||||||
opts.signoff = true;
|
opts.signoff = true;
|
||||||
|
|||||||
Reference in new issue
Block a user