瀏覽代碼

Fixes #2342 treats local remotes as local

main
Eric Amodio 2 年之前
父節點
當前提交
60816c2c5b
共有 2 個檔案被更改,包括 7 行新增2 行删除
  1. +1
    -0
      CHANGELOG.md
  2. +6
    -2
      src/env/node/git/localGitProvider.ts

+ 1
- 0
CHANGELOG.md 查看文件

@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#2342](https://github.com/gitkraken/vscode-gitlens/issues/2342) - Local remotes are incorrectly treated as private
- Fixes [#2052](https://github.com/gitkraken/vscode-gitlens/issues/2052) - Interactive Rebase fails to start when using xonsh shell due to command quoting
- Fixes [#2141](https://github.com/gitkraken/vscode-gitlens/issues/2141) - GitLens's rebase UI randomly fails loading interactive rebase when performed outside of VSC
- Fixes [#1732](https://github.com/gitkraken/vscode-gitlens/issues/1732) - Phantom rebase-merge directory (`rm -rf ".git/rebase-merge"`)

+ 6
- 2
src/env/node/git/localGitProvider.ts 查看文件

@ -478,13 +478,17 @@ export class LocalGitProvider implements GitProvider, Disposable {
const remotes = await this.getRemotes(repoPath, { sort: true });
if (remotes.length === 0) return RepositoryVisibility.Local;
let local = true;
for await (const result of fastestSettled(remotes.map(r => this.getRemoteVisibility(r)))) {
if (result.status !== 'fulfilled') continue;
if (result.value === RepositoryVisibility.Public) return RepositoryVisibility.Public;
if (result.value !== RepositoryVisibility.Local) {
local = false;
}
}
return RepositoryVisibility.Private;
return local ? RepositoryVisibility.Local : RepositoryVisibility.Private;
}
@debug<LocalGitProvider['getRemoteVisibility']>({ args: { 0: r => r.url } })
@ -517,7 +521,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
return RepositoryVisibility.Private;
}
default:
return RepositoryVisibility.Private;
return maybeUri(remote.url) ? RepositoryVisibility.Private : RepositoryVisibility.Local;
}
}

Loading…
取消
儲存