MCPcopy
hub / github.com/refined-github/refined-github / updater

Function updater

source/features/repo-age.tsx:68–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66
67const firstCommit = new CachedFunction('first-commit', {
68 async updater(): Promise<[committedDate: string, lastCommitsPageUrl: string]> {
69 const {repository} = await api.v4(GetFirstCommit);
70
71 const {oid: commitSha, history, committedDate} = repository.defaultBranchRef.target as CommitTarget;
72 const commitsCount = history.totalCount;
73 if (commitsCount === 1) {
74 const lastCommitsPageUrl = buildLastCommitsPageUrl(commitSha, commitsCount);
75 return [committedDate, lastCommitsPageUrl];
76 }
77
78 return getRepoAge(commitSha, commitsCount);
79 },
80 cacheKey: cacheByRepo,
81});
82

Callers

nothing calls this directly

Calls 2

buildLastCommitsPageUrlFunction · 0.85
getRepoAgeFunction · 0.85

Tested by

no test coverage detected