From 73be1953ee70f0e08e33a70db7cadd3c19fccb20 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 8 Mar 2021 16:03:11 -0800 Subject: [PATCH] makefile: Properly detect building with uncommitted changes --- makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 93f21eb0..dc48830b 100644 --- a/makefile +++ b/makefile @@ -290,10 +290,10 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin) else NEED_COMMIT_ID = need-commit-id endif - ifeq (need-commit-id,$(NEED_COMMIT_ID)) - ifneq (,$(shell git update-index --refresh --)) - GIT_EXTRA_FILES=+uncommitted-changes - endif + ifneq (,$(shell git update-index --refresh --)) + GIT_EXTRA_FILES=+uncommitted-changes + endif + ifneq (,$(or $(NEED_COMMIT_ID),$(GIT_EXTRA_FILES))) isodate=$(shell git log -1 --pretty="%ai"|sed -e 's/ /T/'|sed -e 's/ //') $(shell git log -1 --pretty="SIM_GIT_COMMIT_ID %H$(GIT_EXTRA_FILES)%nSIM_GIT_COMMIT_TIME $(isodate)" >.git-commit-id) endif