Skip to content

Commit

Permalink
Add a reproduction case for issue #4429 (#4430)
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Ferguson <me@craigfe.io>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
  • Loading branch information
craigfe authored Apr 1, 2021
1 parent 0aaae54 commit e8ad49f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/blackbox-tests/test-cases/github4429.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Test the behaviour of Dune querying git when the repo has no commit.

Create a repository with no HEAD commit:

$ git init --quiet

... and an executable that links `dune-build-info':

$ echo "(lang dune 2.0)" > dune-project
$ touch main.ml
$ cat >dune <<EOF
> (executable
> (name main)
> (libraries dune-build-info)
> (promote (until-clean)))
> EOF

At the moment Dune fails, which is bad:

$ dune exec ./main.exe 2>&1 | sed 's/.*\/git/{{ git }}/; s/> .*.output/> {{ output_file }}/g'
git (internal) (exit 128)
{{ git }} describe --always --dirty > {{ output_file }}
fatal: bad revision 'HEAD'

0 comments on commit e8ad49f

Please sign in to comment.