MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / getOriginUrl

Function getOriginUrl

packages/backend/src/git.ts:287–300  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

285}
286
287export const getOriginUrl = async (path: string) => {
288 const git = createGitClientForPath(path);
289
290 try {
291 const remotes = await git.getConfig('remote.origin.url', GitConfigScope.local);
292 return remotes.value;
293 } catch (error: unknown) {
294 if (error instanceof Error) {
295 throw new Error(`Failed to get origin for ${path}: ${error.message}`);
296 } else {
297 throw new Error(`Failed to get origin for ${path}: ${error}`);
298 }
299 }
300}
301
302const parseRefNames = (refs: string) =>
303 refs

Callers 1

Calls 1

createGitClientForPathFunction · 0.85

Tested by

no test coverage detected