summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Bailey <cbailey32@bloomberg.net>2014-07-19 17:08:57 +0100
committerJunio C Hamano <gitster@pobox.com>2014-07-21 10:39:48 -0700
commitda33a97998f6d6206c08bd72a527f5b8e6e26d33 (patch)
tree32ff07b3d77cfa00b19cf6970087a1e008c82fc4
parent398dd4bd039680ba98497fbedffa415a43583c16 (diff)
downloadgit-da33a97998f6d6206c08bd72a527f5b8e6e26d33.tar.gz
Fix contrib/subtree Makefile to patch #! line
Signed-off-by: Charles Bailey <cbailey32@bloomberg.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--contrib/subtree/Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
index d888d45161..d9a0ce2c63 100644
--- a/contrib/subtree/Makefile
+++ b/contrib/subtree/Makefile
@@ -18,6 +18,11 @@ RM ?= rm -f
ASCIIDOC = asciidoc
XMLTO = xmlto
+ifndef SHELL_PATH
+ SHELL_PATH = /bin/sh
+endif
+SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
+
ASCIIDOC_CONF = ../../Documentation/asciidoc.conf
MANPAGE_XSL = ../../Documentation/manpage-normal.xsl
@@ -32,7 +37,8 @@ GIT_SUBTREE_HTML := git-subtree.html
all: $(GIT_SUBTREE)
$(GIT_SUBTREE): $(GIT_SUBTREE_SH)
- cp $< $@ && chmod +x $@
+ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' $< >$@
+ chmod +x $@
doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)