mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 11:00:25 +00:00
pkg: Run git update-index --refresh
before git diff-index
.
Otherwise files which have an updated timestamp but no actual changes are marked as changes because `git diff-index` only uses the `lstat` result and not the actual file contents. Running `git update-index --refresh` updates the cache. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
parent
d5535ea3e4
commit
fe918f8a31
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user