diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index c710486..f23e85d 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -2464,8 +2464,8 @@ export class CommandCenter { 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; + const commitGpgSign = await repository.getConfig('commit.gpgsign', 'bool'); + opts.signCommit = commitGpgSign === 'false' ? undefined : true; } if (config.get('alwaysSignOff')) { diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 0ad28a7..c34542a 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -1411,13 +1411,17 @@ export class Repository { return this.git.spawn(args, options); } - async config(command: string, scope: string, key: string, value: any = null, options: SpawnOptions = {}): Promise { + async config(command: string, scope: string, key: string, value: any = null, options: SpawnOptions = {}, type?: string): Promise { const args = ['config', `--${command}`]; if (scope) { args.push(`--${scope}`); } + if (type) { + args.push(`--${type}`); + } + args.push(key); if (value) { diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index 046422c..dad1fbc 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -1146,8 +1146,8 @@ export class Repository implements Disposable { return this.run(Operation.Config(true), () => this.repository.getConfigs('local')); } - getConfig(key: string): Promise { - return this.run(Operation.Config(true), () => this.repository.config('get', 'local', key)); + getConfig(key: string, type?: string): Promise { + return this.run(Operation.Config(true), () => this.repository.config('get', 'local', key, null, {}, type)); } getGlobalConfig(key: string): Promise {