Closed
Description
Hi,
This is a bit of an edge case but I think that's worth reporting.
When running dune subst
in a git repository with no commit, the following error happens:
$ cat > dune-project <<EOF
> (lang dune 1.0)
> (name foo)
> EOF
$ echo 'authors: [ "John Doe <john@doe.com>" ]' > foo.opam
$ git init --quiet
$ dune subst
git (internal) (exit 128)
/usr/bin/git describe --always --dirty > /tmp/dune.cram.43198erun.t/tmp/dune3a97db.output
fatal: bad revision 'HEAD'
git (internal) (exit 128)
/usr/bin/git rev-parse HEAD > /tmp/dune.cram.43198erun.t/tmp/dune7e6051.output
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
git (internal) (exit 128)
/usr/bin/git ls-tree -r --name-only HEAD > /tmp/dune.cram.43198erun.t/tmp/dune2547a1.output
fatal: Not a valid object name HEAD
[1]
This happened to me while opam pinning a new package. I started working on a fix, but it's a bit complex because we need to both get the git error code and its output, which we don't do at the moment, so I put that on hold.
Metadata
Metadata
Assignees
Labels
No labels