Skip to content
Français

repositoryFingerprint

import { repositoryFingerprint } from "@elie-laloum/outpost";

Return a SHA-256 hex digest of a repository’s HEAD commit, staged and unstaged changes and untracked files that are not ignored, excluding .outpost/. Use it in a task cache key so uncommitted edits change the key. Reads without modifying; rejects outside a Git repository.

Complete example and detailed rules.

  • repositoryRequired
    string
    Path to a Git repository or one of its subdirectories; the fingerprint always covers the whole working tree.

Promise<string>

export declare function repositoryFingerprint(
  repository: string,
): Promise<string>;