Skip to content

feat(git): add IsAncestor, BranchExists, and RemoteBranchSHA helpers - #99

Merged
joshua-temple merged 2 commits into
mainfrom
feat/git-ancestry-primitives
Jun 11, 2026
Merged

joshua-temple merged 2 commits into
mainfrom
feat/git-ancestry-primitives

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Adds three git helper primitives needed by the hotfix plan and finalize verbs:

  • IsAncestor - wraps git merge-base --is-ancestor to check commit ancestry
  • BranchExists - checks for a remote-tracking ref by running git rev-parse --verify
  • RemoteBranchSHA - resolves a remote-tracking ref to its SHA

All three include godoc documenting fetch-depth requirements and shallow-clone caveats.

Verification: go build ./... && go test ./internal/git/... -race && golangci-lint run ./internal/git/... all pass.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit 74c32e7 into main Jun 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant