MCPcopy Index your code
hub / github.com/coderoad/coderoad-vscode / addRemote

Function addRemote

src/services/git/index.ts:122–134  ·  view source on GitHub ↗
(repo: string)

Source from the content-addressed store, hash-verified

120}
121
122export async function addRemote(repo: string): Promise<never | void> {
123 const { stderr } = await exec({ command: `git remote add ${gitOrigin} ${repo} && git fetch ${gitOrigin}` })
124 if (stderr) {
125 const alreadyExists = stderr.match(`${gitOrigin} already exists.`)
126 const successfulNewBranch = stderr.match('new branch')
127
128 // validate the response is acceptable
129 if (!alreadyExists && !successfulNewBranch) {
130 logger(`Error: ${stderr}`)
131 throw new Error('Error adding git remote')
132 }
133 }
134}
135
136export async function checkRemoteExists(): Promise<boolean> {
137 try {

Callers 1

setupCodeRoadRemoteFunction · 0.85

Calls 2

execFunction · 0.90
loggerFunction · 0.50

Tested by

no test coverage detected