Ensure git status is tracked at the correct time

The previous version would verify git status at time of `make verify` execution, but before all its dependencies executed.
If one of the dependencies resulted in a dirty git, the check would still pass.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
This commit is contained in:
Paulo Gomes 2022-05-09 15:54:55 +01:00
parent 43235df2b8
commit c936fc145b
No known key found for this signature in database
GPG Key ID: 9995233870E99BEE
1 changed files with 6 additions and 7 deletions

View File

@ -225,13 +225,12 @@ ifneq ($(shell grep -o 'LIBGIT2_TAG ?= \w.*' Makefile | cut -d ' ' -f 3), $(shel
exit 1; \
}
endif
ifneq (, $(shell git status --porcelain --untracked-files=no))
@{ \
@if [ ! "$$(git status --porcelain --untracked-files=no)" = "" ]; then \
echo "working directory is dirty:"; \
git --no-pager diff; \
exit 1; \
}
endif
fi
# go-install-tool will 'go install' any package $2 and install it to $1.
define go-install-tool