/** * The base branch a checkout is measured against, and how far a revision * trails it (T14007). * * One home for "origin's default branch": change-set, affected-packages and * gate-runner each carried their own copy, and NEXUS freshness needs the same * answer to say how many commits an index is behind. * * Code placed in `packages/core/` per Package-Boundary Check — verified against AGENTS.md. * * @module git/base-ref * @task T14007 */ /** * `origin/` from `refs/remotes/origin/HEAD`, else `origin/main` or * `origin/master` when that remote branch exists. * * @param root - Repository to ask. * @returns The remote-tracking ref, or `null` when origin has no default branch here. * @example * ```ts * resolveOriginDefault('/repo'); // 'origin/main' * ``` */ export declare function resolveOriginDefault(root: string): string | null; /** * The ref a checkout's freshness is measured against: origin's default branch, * else a local `main` or `master`, else `HEAD` (a remote-less repository). * * @param root - Repository to ask. * @returns The ref, or `null` when `root` is not a git repository with a commit. * @example * ```ts * resolveBaseRef('/repo'); // 'origin/main' * ``` */ export declare function resolveBaseRef(root: string): string | null; /** * The commit a ref names. * * @param root - Repository to ask. * @param ref - Ref or revision. * @returns The full sha, or `null` when it does not resolve. */ export declare function revParse(root: string, ref: string): string | null; /** * Commits reachable from `to` but not from `from` (`git rev-list --count from..to`). * * @param root - Repository to ask. * @param from - The older revision (e.g. an index's revision). * @param to - The newer revision (e.g. the base branch). * @returns The count, or `null` when either revision is unknown here. * @example * ```ts * commitsBetween('/repo', indexedSha, 'origin/main'); // 3239 * ``` */ export declare function commitsBetween(root: string, from: string, to: string): number | null; /** * Tracked files that differ between `rev` and the working tree (`git diff * --name-only rev`), counted without walking the tree (T14014). * * @param root - Repository to ask. * @param rev - The revision to compare against (e.g. an index's revision). * @returns The count, or `null` when `rev` is unknown here. * @example * ```ts * changedFilesSince('/repo', indexedSha); // 2656 * ``` */ export declare function changedFilesSince(root: string, rev: string): number | null; /** * The merge-base of HEAD and origin's default branch: where the branch's own * commits begin. * * @param root - Repository to ask. * @returns The merge-base commit, or `null` when there is no origin default * branch or git fails. */ export declare function originDefaultMergeBase(root: string): string | null; //# sourceMappingURL=base-ref.d.ts.map