mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 10:58:34 -05:00
Fixes issue with open in remote not showing with no editors
This commit is contained in:
@@ -114,13 +114,15 @@ export class GitContextTracker extends Disposable {
|
|||||||
|
|
||||||
private async _updateContextHasRemotes(uri: GitUri | undefined) {
|
private async _updateContextHasRemotes(uri: GitUri | undefined) {
|
||||||
try {
|
try {
|
||||||
|
let repoPath = this.git.repoPath;
|
||||||
|
if (uri !== undefined && this.git.isTrackable(uri)) {
|
||||||
|
repoPath = uri.repoPath || this.git.repoPath;
|
||||||
|
}
|
||||||
|
|
||||||
let hasRemotes = false;
|
let hasRemotes = false;
|
||||||
if (uri && this.git.isTrackable(uri)) {
|
if (repoPath) {
|
||||||
const repoPath = uri.repoPath || this.git.repoPath;
|
const remotes = await this.git.getRemotes(repoPath);
|
||||||
if (repoPath) {
|
hasRemotes = remotes.length !== 0;
|
||||||
const remotes = await this.git.getRemotes(repoPath);
|
|
||||||
hasRemotes = remotes.length !== 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setCommandContext(CommandContext.HasRemotes, hasRemotes);
|
setCommandContext(CommandContext.HasRemotes, hasRemotes);
|
||||||
|
|||||||
Reference in New Issue
Block a user