MCPcopy Create free account
hub / github.com/desktop/desktop / forkRepository

Method forkRepository

app/src/lib/api.ts:1139–1154  ·  view source on GitHub ↗

Create a new GitHub fork of this repository (owner and name)

(
    owner: string,
    name: string
  )

Source from the content-addressed store, hash-verified

1137
1138 /** Create a new GitHub fork of this repository (owner and name) */
1139 public async forkRepository(
1140 owner: string,
1141 name: string
1142 ): Promise<IAPIFullRepository> {
1143 try {
1144 const apiPath = `/repos/${owner}/${name}/forks`
1145 const response = await this.ghRequest('POST', apiPath)
1146 return await parsedResponse<IAPIFullRepository>(response)
1147 } catch (e) {
1148 log.error(
1149 `forkRepository: failed to fork ${owner}/${name} at endpoint: ${this.endpoint}`,
1150 e
1151 )
1152 throw e
1153 }
1154 }
1155
1156 /**
1157 * Fetch the issues with the given state that have been created or updated

Callers 1

CreateForkDialogClass · 0.80

Calls 2

ghRequestMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected