Skip to contentSkip to conversation

Print an error if cloning a http repo and NO_CURL is set

PATCH New Fernando J. Pereda 1 participant 1 message Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Print an error if cloning a http repo and NO_CURL is set

If Git is compiled with NO_CURL=YesPlease and one tries to clone a http repository, git-clone tries to call the curl binary. This trivial patch prints an error instead in such situation.

---

 Makefile     |    1 +
 git-clone.sh |    8 +++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

896d96a92a13848ccce19c2f3dee9b5570ef02a7

Makefile +1 -0
index d40aa6a..648469e 100644
@@ -419,6 +419,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.
 	rm -f $@
 	sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
 	    [email protected] >$@
 	chmod +x $@
 
git-clone.sh +7 -1
index 47f3ec9..e192b08 100755
@@ -206,7 +206,13 @@ yes,yes)
 		fi
 		;;
 	http://*)
-		clone_dumb_http "$repo" "$D"
+		if test -z "@@NO_CURL@@"
+		then
+			clone_dumb_http "$repo" "$D"
+		else
+			echo >&2 "http transport not supported, rebuild Git with curl support"
+			exit 1
+		fi
 		;;
 	*)
 		cd "$D" && case "$upload_pack" in
Signature · 1 line
1.2.0