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

Function canAccessRepositoryUsingAPI

app/src/lib/find-account.ts:16–28  ·  view source on GitHub ↗

* Check if the repository designated by the owner and name exists and can be * accessed by the given account.

(
  account: Account,
  owner: string,
  name: string
)

Source from the content-addressed store, hash-verified

14 * accessed by the given account.
15 */
16async function canAccessRepositoryUsingAPI(
17 account: Account,
18 owner: string,
19 name: string
20): Promise<boolean> {
21 const api = API.fromAccount(account)
22 const repository = await api.fetchRepository(owner, name)
23 if (repository) {
24 return true
25 } else {
26 return false
27 }
28}
29
30/**
31 * Find the GitHub account associated with a given remote URL.

Callers

nothing calls this directly

Calls 2

fromAccountMethod · 0.80
fetchRepositoryMethod · 0.80

Tested by

no test coverage detected