fix(examples): support commit SHAs for git_ref in the Harbor adapter 🤖🤖🤖 - #70
Merged
rdasilveiracabral merged 1 commit intoJul 31, 2026
Merged
Conversation
git clone --branch only accepts branch/tag names, so pinning git_ref to a commit SHA failed with exit 128 despite the documented contract. Fetch the ref and check out FETCH_HEAD instead: one path for branches, tags, and full SHAs, still --depth 1. Abbreviated SHAs are not fetchable remotely, so the docstring now says full SHA. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: kmad <3433032+kmad@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The adapter docstring says
git_refaccepts a "branch/tag/SHA", butinstall()passes it togit clone --branch, which rejects commit SHAs — pinning an exact commit fails with exit 128 (fatal: Remote branch <sha> not found).Fix: fetch the ref into an initialized repo and check out
FETCH_HEAD— one code path verified against GitHub for branches, lightweight tags, annotated tags (checkout peels correctly), and full SHAs including non-tip commits, with--depth 1shallowness preserved. Thegit_ref=Nonedefault keeps the existinggit clone --depth 1path unchanged. Abbreviated SHAs resolve in neither the old nor new path, so the docstring now says full SHA.Found while reproducing the tech report's Terminal-Bench results with the repo pinned to an exact commit; the fixed path has since run several hundred trial installs in Daytona containers.
ruff check/ruff format --checkpassexamples/is outside pytest scope🤖 Generated with Claude Code