MCPcopy Index your code
hub / github.com/21st-dev/1code / getRepoUrl

Function getRepoUrl

src/main/lib/git/github/github.ts:75–93  ·  view source on GitHub ↗
(worktreePath: string)

Source from the content-addressed store, hash-verified

73}
74
75async function getRepoUrl(worktreePath: string): Promise<string | null> {
76 try {
77 const { stdout } = await execWithShellEnv(
78 "gh",
79 ["repo", "view", "--json", "url"],
80 { cwd: worktreePath },
81 );
82 const raw = JSON.parse(stdout);
83 const result = GHRepoResponseSchema.safeParse(raw);
84 if (!result.success) {
85 console.error("[GitHub] Repo schema validation failed:", result.error);
86 console.error("[GitHub] Raw data:", JSON.stringify(raw, null, 2));
87 return null;
88 }
89 return result.data.url;
90 } catch {
91 return null;
92 }
93}
94
95async function getPRForBranch(
96 worktreePath: string,

Callers 1

fetchGitHubPRStatusFunction · 0.85

Calls 1

execWithShellEnvFunction · 0.90

Tested by

no test coverage detected