INNER CODE UNIT · TypeScript
gitIndexCacheKeyAsync
modem-dev/hunk · packages/hunk-git/src/index.ts:131
async function gitIndexCacheKeyAsync(
input: GitBackedInput,
repoRoot: string,
gitExecutable: string,
signal?: AbortSignal,
) {
const entries = await runGitTextAsync({
input,
args: ["ls-files", "--stage", "-z"],
cwd: repoRoot,
gitExecutable,
signal,
});
return createHash("sha256").update(entries).digest("hex");
}
/** Describe one resolved endpoint for source-cache reuse across adapter reloads. */
function gitEndpointCacheKey(endpoint: GitDiffEndpoints["old"], indexCacheKey: string) {