summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2020-10-30 10:31:32 -0400
committerAndrew Cady <d@cryptonomic.net>2020-10-30 10:31:32 -0400
commit3287df49902a7a99bf050cb95344096012896ff4 (patch)
treedf7c0882a6e15458453b26d4f69d96595473a1c9 /Makefile
parent1ec4aafb2d627a158e2490349d00b4a4fbc463c0 (diff)
automatically call "git reset" on submodules
if there are NO FILES in the submodule dir, but the git submodule is initialized, then DO NOT treat the submodule as locally modified. Instead, try to remedy the situation. ('git reset' already will avoid destroying data, but it likewise does not treat the absence of a file as data to be preserved.)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 65fdd9a..c327b76 100644
--- a/Makefile
+++ b/Makefile
@@ -125,7 +125,7 @@ include user.mk
125 125
126.PHONY: submodules build-submodules $(SUBMODULES) 126.PHONY: submodules build-submodules $(SUBMODULES)
127$(SUBMODULES): stack 127$(SUBMODULES): stack
128 @a=$$(cd $@ && git status -uno -s) && (if test -z "$$a"; then set -x; git submodule update --init --recursive $@/; fi) 128 @a=$$(cd $@ && (exec 3>&1; exec >&2; if test -z "$$(git ls-files)"; then git reset; fi; git status -uno -s >&3)) && (if test -z "$$a"; then set -x; git submodule update --init --recursive $@/; fi)
129 $(MAKE) -C $@ $(cmd) 129 $(MAKE) -C $@ $(cmd)
130 130
131submodules: build-submodules 131submodules: build-submodules