Skip to content

Commit

Permalink
test: Add reproduction case for #11140 (#11142)
Browse files Browse the repository at this point in the history
* test: Add reproduction case for #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]>
  • Loading branch information
Leonidas-from-XIV authored Nov 22, 2024
1 parent a50384a commit 20e495d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/blackbox-tests/test-cases/pkg/pin-stanza/git-source.t
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,37 @@ In this case Dune can't determine which reference to use and will error out:
Error: Reference "duplicated" in remote
"file://$PWD/_repo"
is ambiguous

Git also has unambibuous namespaces tags and branches, for tags it is `refs/tags/`.

$ cat >dune-project <<EOF
> (lang dune 3.13)
> (pin
> (url "git+file://$PWD/_repo#refs/tags/duplicated")
> (package (name foo)))
> (package
> (name main)
> (depends foo))
> EOF

Locking should work, as there are no ambiguous references.

$ dune pkg lock 2>&1 | tr '\n' ' ' | sed 's#/.*/git #git #'
Error: Command returned nothing: cd git rev-parse --verify --quiet refs/tags/duplicated^{commit}

For branches the namespace is `refs/heads/`:

$ cat >dune-project <<EOF
> (lang dune 3.13)
> (pin
> (url "git+file://$PWD/_repo#refs/heads/duplicated")
> (package (name foo)))
> (package
> (name main)
> (depends foo))
> EOF

Likewise locking a branch this way should work as well:

$ dune pkg lock 2>&1 | tr '\n' ' ' | sed 's#/.*/git #git #'
Error: Command returned nothing: cd git rev-parse --verify --quiet refs/heads/duplicated^{commit}

0 comments on commit 20e495d

Please sign in to comment.