git: let git parse the commit.gpgsign boolean
This commit is contained in:
1 parent
9f2b42c25c
commit
56c9a4d5f6
3 files changed
+9
-5
No files matched your search
@@ -2464,8 +2464,8 @@ export class CommandCenter {
|
|||||||
opts.signCommit = undefined;
|
opts.signCommit = undefined;
|
||||||
|
|
||||||
if (config.get<boolean>('enableCommitSigning') === true) {
|
if (config.get<boolean>('enableCommitSigning') === true) {
|
||||||
const commitGpgSign = await repository.getConfig('commit.gpgsign');
|
const commitGpgSign = await repository.getConfig('commit.gpgsign', 'bool');
|
||||||
opts.signCommit = /^(false|no|off|0)$/i.test(commitGpgSign) ? undefined : true;
|
opts.signCommit = commitGpgSign === 'false' ? undefined : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.get<boolean>('alwaysSignOff')) {
|
if (config.get<boolean>('alwaysSignOff')) {
|
||||||
|
|||||||
@@ -1411,13 +1411,17 @@ export class Repository {
|
|||||||
return this.git.spawn(args, options);
|
return this.git.spawn(args, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
async config(command: string, scope: string, key: string, value: any = null, options: SpawnOptions = {}): Promise<string> {
|
async config(command: string, scope: string, key: string, value: any = null, options: SpawnOptions = {}, type?: string): Promise<string> {
|
||||||
const args = ['config', `--${command}`];
|
const args = ['config', `--${command}`];
|
||||||
|
|
||||||
if (scope) {
|
if (scope) {
|
||||||
args.push(`--${scope}`);
|
args.push(`--${scope}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type) {
|
||||||
|
args.push(`--${type}`);
|
||||||
|
}
|
||||||
|
|
||||||
args.push(key);
|
args.push(key);
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|||||||
@@ -1146,8 +1146,8 @@ export class Repository implements Disposable {
|
|||||||
return this.run(Operation.Config(true), () => this.repository.getConfigs('local'));
|
return this.run(Operation.Config(true), () => this.repository.getConfigs('local'));
|
||||||
}
|
}
|
||||||
|
|
||||||
getConfig(key: string): Promise<string> {
|
getConfig(key: string, type?: string): Promise<string> {
|
||||||
return this.run(Operation.Config(true), () => this.repository.config('get', 'local', key));
|
return this.run(Operation.Config(true), () => this.repository.config('get', 'local', key, null, {}, type));
|
||||||
}
|
}
|
||||||
|
|
||||||
getGlobalConfig(key: string): Promise<string> {
|
getGlobalConfig(key: string): Promise<string> {
|
||||||
|
|||||||
Reference in new issue
Block a user