Skip to content

fix(installer): skip pull after checking out a tag - #284

Open
Spelt wants to merge 1 commit into
HashLoad:mainfrom
Spelt:fix/skip-pull-on-tag
Open

fix(installer): skip pull after checking out a tag#284
Spelt wants to merge 1 commit into
HashLoad:mainfrom
Spelt:fix/skip-pull-on-tag

Conversation

@Spelt

@Spelt Spelt commented Aug 26, 2026

Copy link
Copy Markdown

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:

⚠️ Installation Warnings:
   - <dep>: Error on pull from dependency <repo>
command failed: exit status 1
Stderr: You are not currently on a branch.
Please specify which branch you want to merge with.

Checking out a tag leaves the module worktree in detached HEAD state, and checkoutAndUpdate unconditionally runs git pull afterwards — 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 vet clean; go test ./internal/core/services/installer/... passes
  • Windows 11: boss install https://github.com/viniciussanchez/dataset-serialize:2.5.9 previously 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

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-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@1ea375d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/core/services/installer/core.go 0.00% 8 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #284   +/-   ##
=======================================
  Coverage        ?   28.94%           
=======================================
  Files           ?       90           
  Lines           ?     5701           
  Branches        ?        0           
=======================================
  Hits            ?     1650           
  Misses          ?     3908           
  Partials        ?      143           
Flag Coverage Δ
unittests 28.94% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants