MCPcopy Create free account
hub / github.com/idosal/git-mcp / getCachedFilePath

Function getCachedFilePath

src/api/utils/cache.ts:118–131  ·  view source on GitHub ↗
(
  owner: string,
  repo: string,
  env: Env,
)

Source from the content-addressed store, hash-verified

116 * @returns Object with path and branch if found in cache, null otherwise
117 */
118export async function getCachedFilePath(
119 owner: string,
120 repo: string,
121 env: Env,
122): Promise<{ path: string; branch: string } | null> {
123 try {
124 const key = getRepoFilePathCacheKey(owner, repo);
125 const result = await getFromCache(key, env);
126 return result as { path: string; branch: string } | null;
127 } catch (error) {
128 console.warn("Failed to retrieve from cache:", error);
129 return null;
130 }
131}
132
133/**
134 * Cache a file path for a repository file

Callers 1

searchGitHubRepoFunction · 0.85

Calls 3

getRepoFilePathCacheKeyFunction · 0.85
getFromCacheFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected