Skip to content

Commit 20e495d

Browse files
test: Add reproduction case for ocaml#11140 (ocaml#11142)
* test: Add reproduction case for ocaml#11140 Signed-off-by: Marek Kubica <[email protected]> * Fix for non-GNU sed Signed-off-by: Marek Kubica <[email protected]> --------- Signed-off-by: Marek Kubica <[email protected]>
1 parent a50384a commit 20e495d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/blackbox-tests/test-cases/pkg/pin-stanza/git-source.t

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,37 @@ In this case Dune can't determine which reference to use and will error out:
7373
Error: Reference "duplicated" in remote
7474
"file://$PWD/_repo"
7575
is ambiguous
76+
77+
Git also has unambibuous namespaces tags and branches, for tags it is `refs/tags/`.
78+
79+
$ cat >dune-project <<EOF
80+
> (lang dune 3.13)
81+
> (pin
82+
> (url "git+file://$PWD/_repo#refs/tags/duplicated")
83+
> (package (name foo)))
84+
> (package
85+
> (name main)
86+
> (depends foo))
87+
> EOF
88+
89+
Locking should work, as there are no ambiguous references.
90+
91+
$ dune pkg lock 2>&1 | tr '\n' ' ' | sed 's#/.*/git #git #'
92+
Error: Command returned nothing: cd git rev-parse --verify --quiet refs/tags/duplicated^{commit}
93+
94+
For branches the namespace is `refs/heads/`:
95+
96+
$ cat >dune-project <<EOF
97+
> (lang dune 3.13)
98+
> (pin
99+
> (url "git+file://$PWD/_repo#refs/heads/duplicated")
100+
> (package (name foo)))
101+
> (package
102+
> (name main)
103+
> (depends foo))
104+
> EOF
105+
106+
Likewise locking a branch this way should work as well:
107+
108+
$ dune pkg lock 2>&1 | tr '\n' ' ' | sed 's#/.*/git #git #'
109+
Error: Command returned nothing: cd git rev-parse --verify --quiet refs/heads/duplicated^{commit}

0 commit comments

Comments
 (0)