Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't fail if repo has clashing branch/tag names #11127

Conversation

Leonidas-from-XIV
Copy link
Collaborator

If the duplicate ref isn't referenced then everything should just work, since we never look at it.

If the ref is referenced I opted to special case the fact of both refs pointing to the same place since then there is technically no ambiguity. In the case where they point to different places I opted to error out instead of picking one over the other. This is somewhat of an arbitrary choice as git itself will show a warning that refname '$REF' is ambiguous. and then pick branches over tags (at least in git switch) but depending on the context I don't think this is intuitive.

Anyway, that be revisited but for now this PR fixes the behavior for all cases where there isn't any ambiguity.

Fixes #11113

Fixes ocaml#11113

Signed-off-by: Marek Kubica <marek@tarides.com>
@Leonidas-from-XIV Leonidas-from-XIV merged commit 1aae937 into ocaml:main Nov 18, 2024
28 checks passed
@Leonidas-from-XIV Leonidas-from-XIV deleted the support-overlapping-branches-tags branch November 18, 2024 16:06
Solution for dune.lock:
- foo.dev

If we use the duplicate reference in the condig
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If we use the duplicate reference in the condig
If we use the duplicate reference in the condif

src/dune_pkg/rev_store.ml Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dune pkg lock fails when pinned repo has a tag with the same name as a branch
3 participants