Skip to content

Commit f464d00

Browse files
committed
Auto merge of #3398 - alexcrichton:git-rev, r=alexcrichton
Fix git rev showing up in version number Makefiles didn't support an out-of-tree build, so needed to update them to do so.
2 parents ffa8b6e + b4bfedc commit f464d00

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Makefile.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ endif
2424

2525
CFG_BUILD_DATE = $(shell date +%F)
2626

27-
ifeq ($(wildcard .git),)
27+
ifeq ($(wildcard $(CFG_SRC_DIR)/.git),)
2828
CFG_VERSION = $(CFG_RELEASE) (built $(CFG_BUILD_DATE))
2929
else
30-
CFG_VER_DATE = $(shell git log -1 --date=short --pretty=format:'%cd')
31-
CFG_VER_HASH = $(shell git rev-parse --short HEAD)
30+
CFG_VER_DATE = $(shell git --git-dir='$(CFG_SRC_DIR).git' log -1 --date=short --pretty=format:'%cd')
31+
CFG_VER_HASH = $(shell git --git-dir='$(CFG_SRC_DIR).git' rev-parse --short HEAD)
3232
CFG_VERSION = $(CFG_RELEASE) ($(CFG_VER_HASH) $(CFG_VER_DATE))
3333
endif
3434
PKG_NAME = cargo-$(CFG_PACKAGE_VERS)

0 commit comments

Comments
 (0)