diff --git a/kernel/Makefile b/kernel/Makefile index 2c00fc9a1..fc4e1a6be 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -22,7 +22,7 @@ HASH_COMMIT?=HEAD # Setting this is only really useful with the show-tag target HASH?=$(shell git ls-tree --full-tree $(HASH_COMMIT) -- $(CURDIR) | awk '{print $$3}') ifneq ($(HASH_COMMIT),HEAD) # Others can't be dirty by definition -DIRTY=$(shell git diff-index --quiet HEAD -- $(CURDIR) || echo "-dirty") +DIRTY=$(shell git update-index -q --refresh && git diff-index --quiet HEAD -- $(CURDIR) || echo "-dirty") endif endif diff --git a/pkg/package.mk b/pkg/package.mk index f1592b563..350846778 100644 --- a/pkg/package.mk +++ b/pkg/package.mk @@ -7,7 +7,7 @@ HASH_COMMIT?=HEAD # Setting this is only really useful with the show-tag target HASH?=$(shell git ls-tree --full-tree $(HASH_COMMIT) -- $(CURDIR) | awk '{print $$3}') ifneq ($(HASH_COMMIT),HEAD) # Others can't be dirty by definition -DIRTY=$(shell git diff-index --quiet HEAD -- $(CURDIR) || echo "-dirty") +DIRTY=$(shell git update-index -q --refresh && git diff-index --quiet HEAD -- $(CURDIR) || echo "-dirty") endif endif