MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveRepositories

Function resolveRepositories

apps/sim/connectors/azure-devops/azure-devops.ts:733–751  ·  view source on GitHub ↗

* Resolves the in-scope repositories for the project, caching them on the sync * context so a single sync reuses one listing. Disabled repositories and, when a * filter is set, non-matching repositories are excluded.

(
  accessToken: string,
  organization: string,
  project: string,
  repositoryFilter: string,
  syncContext?: Record<string, unknown>
)

Source from the content-addressed store, hash-verified

731 * filter is set, non-matching repositories are excluded.
732 */
733async function resolveRepositories(
734 accessToken: string,
735 organization: string,
736 project: string,
737 repositoryFilter: string,
738 syncContext?: Record<string, unknown>
739): Promise<GitRepository[]> {
740 const cached = syncContext?.repositories as GitRepository[] | undefined
741 const all =
742 cached ?? (await listRepositories(accessToken, organization, project, undefined, syncContext))
743 if (syncContext && !cached) syncContext.repositories = all
744
745 const needle = repositoryFilter.toLowerCase()
746 return all.filter((repo) => {
747 if (repo.isDisabled) return false
748 if (!needle) return true
749 return repo.id.toLowerCase() === needle || (repo.name ?? '').toLowerCase() === needle
750 })
751}
752
753/**
754 * Lists every blob in a repository at the given branch via the non-paginated

Callers 1

resolveRepoFilesFunction · 0.85

Calls 1

listRepositoriesFunction · 0.85

Tested by

no test coverage detected