chiark / gitweb /
build system: Cope if HEAD refers to a packed ref
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 29 Nov 2019 20:18:14 +0000 (20:18 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 15:49:34 +0000 (15:49 +0000)
In this case, there may be no corresponding .git/refs/<whatever>.
Simply tolerate this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Subdir.sd.mk

index 4d7d35fcddd204ae5445257cd7bb766ab8fa54f1..ead5f5117888ea0dd257f83e22f940f46e58c342 100644 (file)
@@ -112,7 +112,7 @@ secnet:     $(OBJECTS)
 ifneq (,$(wildcard .git/HEAD))
 # If we have (eg) committed, relink and thus regenerate the version
 # with the new info from git describe.
-secnet: Makefile .git/HEAD $(shell sed -n 's#^ref: #.git/#p' .git/HEAD)
+secnet: Makefile .git/HEAD $(wildcard $(shell sed -n 's#^ref: #.git/#p' .git/HEAD))
 secnet: $(wildcard .git/packed-refs)
 endif