mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Git - gif config should not throw if key does not exist (#200358)
This commit is contained in:
parent
2018d1523e
commit
b0b6913211
|
@ -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 }[]> {
|
||||
|
|
|
@ -1474,8 +1474,9 @@ export class Repository implements Disposable {
|
|||
// Git config
|
||||
try {
|
||||
const mergeBase = await this.getConfig(branchMergeBaseConfigKey);
|
||||
if (mergeBase) {
|
||||
return await this.getBranch(mergeBase);
|
||||
if (mergeBase !== '') {
|
||||
const mergeBaseBranch = await this.getBranch(mergeBase);
|
||||
return mergeBaseBranch;
|
||||
}
|
||||
} catch (err) { }
|
||||
|
||||
|
|
Loading…
Reference in a new issue