import type { Repo } from './repo.ts'; import type { Dispatch, IndexState } from './types.ts'; /** What a mutation hands back to the index, before the stat cache is filled. */ export interface StagedEntry { readonly oid: string; readonly mode: number; readonly size: number; } /** * Read `.git/index` through the dispatcher. * * The index is the third thing `status` compares, and the only one that is a * single file: HEAD's tree is assembled from objects and the working tree is * walked, but staged content is one binary blob. * * An absent index is not an error. `git init` writes none until the first * `git add`, and every path is then untracked, which is what an empty table * already says. */ export declare function readIndex(repo: Repo, dispatch: Dispatch): Promise; /** * Replace the staged entries, leaving conflicts alone. * * The stat cache is written zeroed, which git reads as "do not trust it": it * then compares content rather than believing a size or an mtime mirage cannot * promise is meaningful. A zeroed `size` therefore means "not stated" to every * reader here, never "empty". * * @param repo the opened repository * @param staged the paths to set, mapped to what should be recorded for them * @param removed the paths to drop from the index entirely */ export declare function updateIndex(repo: Repo, staged: ReadonlyMap, removed?: Iterable): Promise; //# sourceMappingURL=index_file.d.ts.map