mirror of
https://github.com/containers/skopeo.git
synced 2025-04-28 03:10:18 +00:00
Don't include git commit from a parent directory in the --version output
This can happen when building RPMs out of tarballs (which don't contain the .git repository). To test: > make -n /bin/skopeo; mv .git ../.git ; make -n bin/skopeo Fixes #1707 . Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
4e2dee4362
commit
f36752a279
2
Makefile
2
Makefile
@ -90,7 +90,7 @@ endif
|
||||
CONTAINER_GOSRC = /src/github.com/containers/skopeo
|
||||
CONTAINER_RUN ?= $(CONTAINER_CMD) --security-opt label=disable -v $(CURDIR):$(CONTAINER_GOSRC) -w $(CONTAINER_GOSRC) $(SKOPEO_CIDEV_CONTAINER_FQIN)
|
||||
|
||||
GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null || true)
|
||||
GIT_COMMIT := $(shell GIT_CEILING_DIRECTORIES=$$(cd ..; pwd) git rev-parse HEAD 2> /dev/null || true)
|
||||
|
||||
EXTRA_LDFLAGS ?=
|
||||
SKOPEO_LDFLAGS := -ldflags '-X main.gitCommit=${GIT_COMMIT} $(EXTRA_LDFLAGS)'
|
||||
|
Loading…
Reference in New Issue
Block a user