MCPcopy
hub / github.com/codeaashu/claude-code / validateRepoAtPath

Function validateRepoAtPath

src/utils/githubRepoPathMapping.ts:105–125  ·  view source on GitHub ↗
(
  path: string,
  expectedRepo: string,
)

Source from the content-addressed store, hash-verified

103 * @returns true if the path contains the expected repo, false otherwise
104 */
105export async function validateRepoAtPath(
106 path: string,
107 expectedRepo: string,
108): Promise<boolean> {
109 try {
110 const remoteUrl = await getRemoteUrlForDir(path)
111 if (!remoteUrl) {
112 return false
113 }
114
115 const actualRepo = parseGitHubRepository(remoteUrl)
116 if (!actualRepo) {
117 return false
118 }
119
120 // Case-insensitive comparison
121 return actualRepo.toLowerCase() === expectedRepo.toLowerCase()
122 } catch {
123 return false
124 }
125}
126
127/**
128 * Removes a path from the tracked paths for a given repository.

Callers 1

Calls 2

getRemoteUrlForDirFunction · 0.85
parseGitHubRepositoryFunction · 0.85

Tested by

no test coverage detected