瀏覽代碼

Fixes blank branch name before any commits

main
Eric Amodio 4 年之前
父節點
當前提交
52ddefdce4
共有 1 個檔案被更改,包括 6 行新增1 行删除
  1. +6
    -1
      src/git/git.ts

+ 6
- 1
src/git/git.ts 查看文件

@ -1065,7 +1065,12 @@ export namespace Git {
} catch (ex) {
const msg: string = ex?.toString() ?? '';
if (GitErrors.badRevision.test(msg) || GitWarnings.noUpstream.test(msg)) {
return [ex.stdout, undefined];
if (ex.stdout != null && ex.stdout.length !== 0) {
return [ex.stdout, undefined];
}
const defaultBranch = await config__get('init.defaultBranch', repoPath, { local: true });
return [defaultBranch ?? 'main', undefined];
}
if (GitWarnings.headNotABranch.test(msg)) {

Loading…
取消
儲存