Skip to content

Commit da33a97

Browse files
hashplinggitster
authored andcommitted
Fix contrib/subtree Makefile to patch #! line
Signed-off-by: Charles Bailey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 398dd4b commit da33a97

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

contrib/subtree/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ RM ?= rm -f
1818
ASCIIDOC = asciidoc
1919
XMLTO = xmlto
2020

21+
ifndef SHELL_PATH
22+
SHELL_PATH = /bin/sh
23+
endif
24+
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
25+
2126
ASCIIDOC_CONF = ../../Documentation/asciidoc.conf
2227
MANPAGE_XSL = ../../Documentation/manpage-normal.xsl
2328

@@ -32,7 +37,8 @@ GIT_SUBTREE_HTML := git-subtree.html
3237
all: $(GIT_SUBTREE)
3338

3439
$(GIT_SUBTREE): $(GIT_SUBTREE_SH)
35-
cp $< $@ && chmod +x $@
40+
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' $< >$@
41+
chmod +x $@
3642

3743
doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
3844

0 commit comments

Comments
 (0)