From f6c7c0f263702fc7cda61e05066bb0875f12a743 Mon Sep 17 00:00:00 2001 From: E Spelt Date: Wed, 26 Aug 2026 20:51:57 +0200 Subject: [PATCH] fix(installer): skip pull after checking out a tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 --- internal/core/services/installer/core.go | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/internal/core/services/installer/core.go b/internal/core/services/installer/core.go index 3a1ca21..3a4ba1c 100644 --- a/internal/core/services/installer/core.go +++ b/internal/core/services/installer/core.go @@ -532,17 +532,22 @@ func (ic *installContext) checkoutAndUpdate( return err } - if !ic.progress.IsEnabled() { - msg.Debug(" 📥 Pulling latest changes for %s", dep.Name()) - } - err = git.Pull(ic.config, dep) - - if err != nil && !errors.Is(err, goGit.NoErrAlreadyUpToDate) { - warnMsg := fmt.Sprintf("Error on pull from dependency %s\n%s", dep.Repository, err) + // Pulling only makes sense on a branch; a tag checkout leaves the + // worktree in detached HEAD state, where git pull fails with + // "You are not currently on a branch." + if referenceName.IsBranch() { if !ic.progress.IsEnabled() { - msg.Warn(" " + warnMsg) + msg.Debug(" 📥 Pulling latest changes for %s", dep.Name()) + } + err = git.Pull(ic.config, dep) + + if err != nil && !errors.Is(err, goGit.NoErrAlreadyUpToDate) { + warnMsg := fmt.Sprintf("Error on pull from dependency %s\n%s", dep.Repository, err) + if !ic.progress.IsEnabled() { + msg.Warn(" " + warnMsg) + } + ic.addWarning(fmt.Sprintf("%s: %s", dep.Name(), warnMsg)) } - ic.addWarning(fmt.Sprintf("%s: %s", dep.Name(), warnMsg)) } // Normalize line endings to CRLF on Windows (Issue #197)