Fix detached checkout of non-default dependency branches - #3162
Open
Shubham-Padkonde wants to merge 1 commit into
Open
Shubham-Padkonde wants to merge 1 commit into
Shubham-Padkonde wants to merge 1 commit into
Conversation
|
Thanks for your Pull Request and making D better! This comment will automatically be updated to summarize some statistics in a few minutes. |
Contributor
Author
|
Buildkite 4215 stopped before compilation because |
This branch has not been deployed
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.
Non-default branches in Git repository dependencies fail with
fatal: --detach cannot be used with -b/-B/--orphan: after cloning, the branch exists only as a remote-tracking reference, and Git's automatic local branch creation conflicts with detached checkout.Resolve an existing commit reference first, falling back to
refs/remotes/origin/<reference>when it is absent. This preserves default-branch, commit-hash, and tag behavior, including a tag sharing its name with a remote branch.The regression creates a local Git repository and runs a real DUB consumer against four references, checking the dependency's compiled value. The non-default branch fails before the fix; all four cases pass afterward. The fixture uses isolated temporary repositories and package caches, without a network dependency.
Validation on Linux, LDC 1.43.0:
ldc2 -run build.dwithDMD=ldmd2: passed.test/issue3047-git-branch.sh: all four consumer builds/runs passed.dub test --compiler=ldc2 --skip-registry=all -c library: 59 modules passed.git diff --check: passed.Fixes #3047 for the dependency checkout failure. The separately reported Windows cleanup/access-denied path has not been tested or changed. Full OS/compiler integration matrix not run.
Developed and tested with OpenAI Codex assistance; no independent human review is claimed.