Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 284f982

Browse files
Look for configured remote name instead of hardcoded "origin"
1 parent 3614840 commit 284f982

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/git/repository.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Octokit } from "@octokit/rest";
77
import { Protocol } from "../external/protocol";
88
import { getClient } from "../api/api";
99
import { getSession } from "../auth/auth";
10+
import { getRemoteName } from "../configuration/configuration";
1011

1112
async function getGitExtension(): Promise<API | undefined> {
1213
const gitExtension =
@@ -58,15 +59,15 @@ export async function getGitHubUrls(): Promise<
5859
if (git && git.repositories.length > 0) {
5960
logDebug("Found git extension");
6061

62+
const remoteName = getRemoteName();
63+
6164
const p = await Promise.all(
6265
git.repositories.map(async (r) => {
6366
logDebug("Find `origin` remote for repository", r.rootUri.path);
6467
await r.status();
6568

66-
// In the future we might make this configurable, but for now continue to look
67-
// for a remote named "origin".
6869
const originRemote = r.state.remotes.filter(
69-
(remote) => remote.name === "origin"
70+
(remote) => remote.name === remoteName
7071
);
7172
if (
7273
originRemote.length > 0 &&
@@ -81,7 +82,7 @@ export async function getGitHubUrls(): Promise<
8182
};
8283
}
8384

84-
logDebug("No `origin` remote found, skipping repository");
85+
logDebug(`Remote "${remoteName}" not found, skipping repository`);
8586

8687
return undefined;
8788
})

0 commit comments

Comments
 (0)