Skip to content

Commit

Permalink
Makefile: Fix repository dirty status check
Browse files Browse the repository at this point in the history
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 <root@stephanos.io>
  • Loading branch information
stephanosio committed Jun 5, 2020
1 parent 8595bea commit 38d0fa3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38d0fa3

Please sign in to comment.