fix(installer): skip pull after checking out a tag - #284
Open
Spelt wants to merge 1 commit into
Open
Conversation
Installing a dependency pinned to a version tag checks out that tag, which leaves the module worktree in detached HEAD state. The unconditional pull that follows then fails and surfaces a warning on every install/update: Error on pull from dependency <repo> command failed: exit status 1 Stderr: You are not currently on a branch. A tag is a fixed reference — there is nothing to pull into it. Only pull when the checked-out reference is a branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #284 +/- ##
=======================================
Coverage ? 28.94%
=======================================
Files ? 90
Lines ? 5701
Branches ? 0
=======================================
Hits ? 1650
Misses ? 3908
Partials ? 143
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Problem
Installing a dependency pinned to a version tag (e.g.
boss install https://host/owner/repo:1.2.3) surfaces a warning on every install/update:Checking out a tag leaves the module worktree in detached HEAD state, and
checkoutAndUpdateunconditionally runsgit pullafterwards — which git refuses without a current branch.Fix
A tag is a fixed reference; there is nothing to pull into it. Only pull when the checked-out reference is a branch (
referenceName.IsBranch()). The line-ending normalization step still runs for both cases.Testing
go build ./...,go vetclean;go test ./internal/core/services/installer/...passesboss install https://github.com/viniciussanchez/dataset-serialize:2.5.9previously warned "You are not currently on a branch" on the pull; with this patch the install completes with no warnings, and branch-based dependencies still pull updates as before