mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 15:24:40 +01:00
Git - add the ability to disable commit signing (#291822)
This commit is contained in:
5
extensions/git/src/api/git.d.ts
vendored
5
extensions/git/src/api/git.d.ts
vendored
@@ -177,6 +177,11 @@ export interface CommitOptions {
|
||||
all?: boolean | 'tracked';
|
||||
amend?: boolean;
|
||||
signoff?: boolean;
|
||||
/**
|
||||
* true - sign the commit
|
||||
* false - do not sign the commit
|
||||
* undefined - use the repository/global git config
|
||||
*/
|
||||
signCommit?: boolean;
|
||||
empty?: boolean;
|
||||
noVerify?: boolean;
|
||||
|
||||
@@ -2306,7 +2306,6 @@ export class CommandCenter {
|
||||
}
|
||||
|
||||
let enableSmartCommit = config.get<boolean>('enableSmartCommit') === true;
|
||||
const enableCommitSigning = config.get<boolean>('enableCommitSigning') === true;
|
||||
let noStagedChanges = repository.indexGroup.resourceStates.length === 0;
|
||||
let noUnstagedChanges = repository.workingTreeGroup.resourceStates.length === 0;
|
||||
|
||||
@@ -2380,8 +2379,9 @@ export class CommandCenter {
|
||||
}
|
||||
}
|
||||
|
||||
// enable signing of commits if configured
|
||||
opts.signCommit = enableCommitSigning;
|
||||
// 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;
|
||||
|
||||
if (config.get<boolean>('alwaysSignOff')) {
|
||||
opts.signoff = true;
|
||||
|
||||
@@ -2073,8 +2073,12 @@ export class Repository {
|
||||
args.push('--signoff');
|
||||
}
|
||||
|
||||
if (opts.signCommit) {
|
||||
args.push('-S');
|
||||
if (opts.signCommit !== undefined) {
|
||||
if (opts.signCommit) {
|
||||
args.push('-S');
|
||||
} else {
|
||||
args.push('--no-gpg-sign');
|
||||
}
|
||||
}
|
||||
|
||||
if (opts.empty) {
|
||||
|
||||
Reference in New Issue
Block a user