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

Method fetchRepository

app/src/lib/api.ts:973–988  ·  view source on GitHub ↗

Fetch a repo by its owner and name.

(
    owner: string,
    name: string
  )

Source from the content-addressed store, hash-verified

971
972 /** Fetch a repo by its owner and name. */
973 public async fetchRepository(
974 owner: string,
975 name: string
976 ): Promise<IAPIFullRepository | null> {
977 try {
978 const response = await this.ghRequest('GET', `repos/${owner}/${name}`)
979 if (response.status === HttpStatusCode.NotFound) {
980 log.warn(`fetchRepository: '${owner}/${name}' returned a 404`)
981 return null
982 }
983 return await parsedResponse<IAPIFullRepository>(response)
984 } catch (e) {
985 log.warn(`fetchRepository: an error occurred for '${owner}/${name}'`, e)
986 return null
987 }
988 }
989
990 /**
991 * Fetch info needed to clone a repository. That includes:

Calls 2

ghRequestMethod · 0.95
warnMethod · 0.80

Tested by

no test coverage detected