From 581a63c5f1debdd0629c379e1c8355b56ff59d61 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sun, 24 Mar 2024 19:29:29 +0200 Subject: [PATCH] docker: ensure working directory is clean Using git archive to transfer files to the docker images means uncommitted modifications aren't transfered. It can be confusing if the modifications aren't reflected in the results. Fail with a warning message if the working directory is not clean. --- docker/Makefile.local | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Makefile.local b/docker/Makefile.local index 695fb1cb..f7a462a0 100644 --- a/docker/Makefile.local +++ b/docker/Makefile.local @@ -8,6 +8,8 @@ HAWKMOTH_VERSION := $(shell cat src/hawkmoth/VERSION) HAWKMOTH_ARCHIVE := $(docker_dir)/hawkmoth-$(HAWKMOTH_VERSION).tar.gz $(HAWKMOTH_ARCHIVE): $(shell git ls-files) + @test -z "$(shell git status --porcelain --untracked-files=no)" || \ + (echo "error: git working directory is not clean" && false) git archive -o $@ HEAD # Containers for local testing