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

Function readLastFetchTime

src/utils/deepLink/banner.ts:88–102  ·  view source on GitHub ↗
(
  cwd: string,
)

Source from the content-addressed store, hash-verified

86 * a worktree.
87 */
88export async function readLastFetchTime(
89 cwd: string,
90): Promise<Date | undefined> {
91 const gitDir = await getGitDir(cwd)
92 if (!gitDir) return undefined
93 const commonDir = await getCommonDir(gitDir)
94 const [local, common] = await Promise.all([
95 mtimeOrUndefined(join(gitDir, 'FETCH_HEAD')),
96 commonDir
97 ? mtimeOrUndefined(join(commonDir, 'FETCH_HEAD'))
98 : Promise.resolve(undefined),
99 ])
100 if (local && common) return local > common ? local : common
101 return local ?? common
102}
103
104async function mtimeOrUndefined(p: string): Promise<Date | undefined> {
105 try {

Callers 1

handleDeepLinkUriFunction · 0.85

Calls 4

getGitDirFunction · 0.85
getCommonDirFunction · 0.85
mtimeOrUndefinedFunction · 0.85
resolveMethod · 0.45

Tested by

no test coverage detected