Skip to content

Commit e8ad49f

Browse files
authored
Add a reproduction case for issue #4429 (#4430)
Signed-off-by: Craig Ferguson <me@craigfe.io> Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
1 parent 0aaae54 commit e8ad49f

File tree

1 file changed

+24
-0
lines changed
  • test/blackbox-tests/test-cases/github4429.t

1 file changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Test the behaviour of Dune querying git when the repo has no commit.
2+
3+
Create a repository with no HEAD commit:
4+
5+
$ git init --quiet
6+
7+
... and an executable that links `dune-build-info':
8+
9+
$ echo "(lang dune 2.0)" > dune-project
10+
$ touch main.ml
11+
$ cat >dune <<EOF
12+
> (executable
13+
> (name main)
14+
> (libraries dune-build-info)
15+
> (promote (until-clean)))
16+
> EOF
17+
18+
At the moment Dune fails, which is bad:
19+
20+
$ dune exec ./main.exe 2>&1 | sed 's/.*\/git/{{ git }}/; s/> .*.output/> {{ output_file }}/g'
21+
git (internal) (exit 128)
22+
{{ git }} describe --always --dirty > {{ output_file }}
23+
fatal: bad revision 'HEAD'
24+

0 commit comments

Comments
 (0)