From 38d0fa307d6cdacd37a8bbf3542cdcb6a8f0ceee Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Fri, 5 Jun 2020 16:31:37 +0900 Subject: [PATCH] Makefile: Fix repository dirty status check Using `git diff-index` returns "dirty" status even when a file is only "touched" and there is no actual change in the repository. This commit replaces the dirty status check with an implementation based on `git diff`, which does not suffer the problem mentioned above. Signed-off-by: Stephanos Ioannidis --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 83df336d69..967a2c8093 100644 --- a/Makefile +++ b/Makefile @@ -96,9 +96,7 @@ QEMU_PKGVERSION := $(if $(PKGVERSION),$(PKGVERSION),$(shell \ cd $(SRC_PATH); \ if test -e .git; then \ git describe --match 'zephyr-qemu-v*' 2>/dev/null | tr -d '\n'; \ - if ! git diff-index --quiet HEAD &>/dev/null; then \ - echo "-dirty"; \ - fi; \ + git diff --quiet 2>/dev/null || echo '-dirty'; \ fi)) # Either "version (pkgversion)", or just "version" if pkgversion not set