Skip to content

Commit

Permalink
feat: prefer "origin" or "upstream" remote if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg authored Jul 12, 2024
1 parent 7e0d977 commit 21838f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export function activate(context: vscode.ExtensionContext) {
return;
}

const fetchUrl = repository.state.remotes[0].fetchUrl;
const remote = repository.state.remotes.find((r) => ['origin', 'upstream'].includes(r.name)) ||
repository.state.remotes[0]
const fetchUrl = remote.fetchUrl;
const httpsUrl = normalize(fetchUrl!);

const upperPath = repository.rootUri.fsPath;
Expand Down

0 comments on commit 21838f7

Please sign in to comment.