Repository navigation
Conversation
Keep branch-first lookup for short names and fall back to a tag only when no branch exists. Use the existing HEAD setter to peel tags and detach, and accept explicit refs/heads/ and refs/tags/ selections. Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Describe explicit branch and tag references, branch-first short names, and detached HEAD behavior when selecting a tag. Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Cover lightweight and nested annotated tags, explicit refs, branch/tag collisions, bare and transported clones, and invalid checkout cleanup. Check detached HEAD, tracking configuration and preserved remote HEAD. Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Author
|
Could a maintainer review this clone support for tags and explicit branch references? Please let me know whether this behavior is wanted or if changes or additional cases are needed before review. Thanks. |
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.
Fixes #3218.
checkout_branchcurrently treats every selection as a remote branch name, so a tag or an explicitrefs/heads/...reference cannot be selected when cloning.This keeps branch-first lookup for short names and falls back to a tag only when the branch is absent. Explicit
refs/heads/...selects only a branch; explicitrefs/tags/...selects only a tag. Tag selections use the existing HEAD setter to peel annotated tags and detach HEAD at the target commit. Normal branch tracking and the remote's default HEAD are preserved.The API documentation now describes these choices. Twelve local regression tests cover lightweight and nested annotated tags, branch/tag collisions, explicit references, bare clones, the non-optimized file transport, missing selections and non-commit tags. They also check tracking configuration, detached HEAD and cleanup on failure. Arbitrary revision expressions are not added.
Validation on Linux, based on
42a89d7cc9374a19e72fa57011e5fe3a99c7b3bf:ENABLE_WERROR=ONpass. HTTPS, SSH, NTLM and Negotiate were disabled because their development dependencies are unavailable here.clone.c, seven positive regression cases fail and five control cases pass.bad_urlswas not included because its network attempts timed out.-xonline -xclone::nonetwork) reports 3,103 executions, 45 skips and no failures. The same Debug selection has onestructinitpadding failure, reproduced after restoring the originalclone.c.No shallow HTTP/SSH, Windows or macOS validation is claimed.