Git - gif config should not throw if key does not exist (#200358)

This commit is contained in:
Ladislau Szomoru
2023-12-08 15:10:52 +01:00
committed by GitHub
parent 2018d1523e
commit b0b6913211
2 changed files with 11 additions and 4 deletions

View File

@@ -1017,8 +1017,14 @@ export class Repository {
args.push(value);
}
const result = await this.exec(args, options);
return result.stdout.trim();
try {
const result = await this.exec(args, options);
return result.stdout.trim();
}
catch (err) {
this.logger.warn(`git config failed: ${err.message}`);
return '';
}
}
async getConfigs(scope: string): Promise<{ key: string; value: string }[]> {