Skip to content

Commit

Permalink
build: fix build when we don't have a full git tree
Browse files Browse the repository at this point in the history
When building with docker, we don't have a _full_ git repo.
  • Loading branch information
Stebalien committed Sep 4, 2019
1 parent 5b44f48 commit aba6c3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mk/git.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
git-hash:=$(shell git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null)

# First try to "describe" the state. This tells us if the state is dirty.
# If that fails (e.g., we're building a docker image and have an empty objects
# directory), assume the source isn't dirty and build anyways.
git-hash:=$(shell git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)

0 comments on commit aba6c3d

Please sign in to comment.