Repository navigation
fix(git): check out the declared branch after clone+submodule registration - #16
Merged
Merged
Conversation
…ation git submodule add -b records the branch for update --remote, but the worktree pre-cloned by the async batch path stays on the default branch (coc.nvim only ships its compiled dist on the release branch). Covered by tests/branch_clone.vader (sync path, pre-cloned worktree).
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.
Issue for this PR
Found while standing up the myvim CI: a fresh install left coc.nvim on its
default branch (
build/index.js not found) even though the vimrc declares{'branch': 'release'}. The async batch path pre-clones without-b, andgit submodule add -bonly records the branch in .gitmodules for laterupdates - the worktree HEAD stays wherever the pre-clone put it.
Changes
git#add_submodule: after the submodule registration, check out thedeclared branch (reuses
s:checkout_version, same precedence ascommit/tag pins).
tests/branch_clone.vader: sync path + pre-cloned worktree (the asyncshape) both assert the declared branch is checked out and its content
present.
Tests (mandatory)
Red-green:
tests/branch_clone.vader"branch checkout applies to apre-cloned worktree" fails before the fix (HEAD stays on the default
branch) and passes after. Full suite: 218/219 locally (the 1 local failure,
lazy.vader E216, pre-exists on main and passes in CI).
Linked Issue
Refs the myvim CI rollout (log0u7/repo-template).