Fork Horse repository, listed by its owner. Publisher snapshot.

packages/forkhorse-core/src/artifacts.ts

Snapshot at 34e3175

Containing directory

314 bytes · typescriptView raw
1import { ZERO_SHA } from "./trees";
2import type { Repository } from "./types";
3
4/** Artifacts log resolves bare branch names, unlike Git wire refs. */
5export async function branchHead(repo: Repository, branch: string): Promise<string> {
6  return (await repo.log({ ref: branch, limit: 1 }))[0]?.hash ?? ZERO_SHA;
7}
8