Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'