Skip to content
Français

checkSpeculationIntegration

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

Test with git merge-tree whether a candidate branch merges into the host checkout’s HEAD, without changing its files or index. Returns clean or conflict with the exact commits tested, or blocked when the checkout is dirty or detached, the branch moved or Git fails. It never merges.

Complete example and detailed rules.

  • repositoryRequired
    string
    Host Git checkout to test; it must be clean and on a branch.
  • branchRequired
    string
    Candidate branch or ref, resolved to a commit and tested against the checkout’s HEAD.
  • expectedCommitOptional
    string | undefined
    Commit validated earlier, usually winner.commit; the check is blocked if the branch no longer points to it.

Promise<SpeculationIntegration>

export declare function checkSpeculationIntegration(
  repository: string,
  branch: string,
  expectedCommit?: string,
): Promise<SpeculationIntegration>;