From 9ecf2d9f5e4f6504a08e34e438af3a853ebc72b5 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 6 Jan 2016 06:23:38 -0800 Subject: [PATCH] force git repo root when computing version info Summary: public closes #230 Reviewed By: jberdine Differential Revision: D2807153 fb-gh-sync-id: 7487db0 --- infer/src/Makefile.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/infer/src/Makefile.in b/infer/src/Makefile.in index 9697a1b9d..5de5f6aff 100644 --- a/infer/src/Makefile.in +++ b/infer/src/Makefile.in @@ -265,8 +265,8 @@ endif version: $(BACKEND_SOURCES)/version.ml.in Makefile TMPFILE=$$(mktemp $(BACKEND_SOURCES)/version.ml.tmp.XXXX); \ - INFER_GIT_COMMIT=$$(git rev-parse --short HEAD || printf "unknown"); \ - INFER_GIT_BRANCH=$$(git rev-parse --abbrev-ref HEAD || printf "unknown"); \ + INFER_GIT_COMMIT=$$(git --work-tree=$(ROOT_DIR) --git-dir=$(ROOT_DIR)/.git rev-parse --short HEAD || printf "unknown"); \ + INFER_GIT_BRANCH=$$(git --work-tree=$(ROOT_DIR) --git-dir=$(ROOT_DIR)/.git rev-parse --abbrev-ref HEAD || printf "unknown"); \ sed \ -e 's|@INFER_MAJOR[@]|$(INFER_MAJOR)|g' \ -e 's|@INFER_MINOR[@]|$(INFER_MINOR)|g' \ @@ -275,8 +275,8 @@ version: $(BACKEND_SOURCES)/version.ml.in Makefile -e "s|@INFER_GIT_COMMIT[@]|$$INFER_GIT_COMMIT|g" \ -e "s|@INFER_GIT_BRANCH[@]|$$INFER_GIT_BRANCH|g" \ $< > "$$TMPFILE"; \ - @INSTALL@ -m 644 -C $$TMPFILE $(BACKEND_SOURCES)/version.ml; \ - rm -f $$TMPFILE + @INSTALL@ -m 644 -C "$$TMPFILE" $(BACKEND_SOURCES)/version.ml; \ + rm -f "$$TMPFILE" $(BUILD_DIR): $(MKDIR) $(BUILD_DIR)