From 3ff25a4065efd86c65ad9c168c6f79f3e16ff036 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Wed, 9 Feb 2022 17:37:13 +0000 Subject: [PATCH] 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 --- Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 039ea68f1..cd7a4c401 100644 --- a/Makefile +++ b/Makefile @@ -208,13 +208,12 @@ ifneq ($(shell grep -o 'LIBGIT2_IMG ?= \w.*' Makefile | cut -d ' ' -f 3):$(shell exit 1; \ } endif -ifneq (, $(shell git status --porcelain --untracked-files=no)) - @{ \ - echo "working directory is dirty:"; \ - git --no-pager diff; \ - exit 1; \ - } -endif + + @if [ ! "$$(git status --porcelain --untracked-files=no)" = "" ]; then \ + echo "working directory is dirty:"; \ + git --no-pager diff; \ + exit 1; \ + fi # go-install-tool will 'go install' any package $2 and install it to $1. define go-install-tool