From 3ea099d48b15f69889f4efe71599c9dfde6bb26a Mon Sep 17 00:00:00 2001 From: Sasha Khapyorsky Date: Fri, 29 Sep 2006 03:10:44 +0300 Subject: http/ftp: optionally ask curl to not use EPSV command If http.noEPSV config variable is defined and true, or if GIT_CURL_FTP_NO_EPSV environment variable is defined, disable using of EPSV ftp command (PASV will be used instead). This is helpful with some "poor" ftp servers which does not support EPSV mode. Signed-off-by: Sasha Khapyorsky Signed-off-by: Junio C Hamano --- git-fetch.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'git-fetch.sh') diff --git a/git-fetch.sh b/git-fetch.sh index 50ad101e89..bcc67ab0b0 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -289,6 +289,10 @@ fetch_main () { if [ -n "$GIT_SSL_NO_VERIFY" ]; then curl_extra_args="-k" fi + if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \ + "`git-repo-config --bool http.noEPSV`" = true ]; then + noepsv_opt="--disable-epsv" + fi max_depth=5 depth=0 head="ref: $remote_name" @@ -300,7 +304,7 @@ fetch_main () { $u =~ s{([^-a-zA-Z0-9/.])}{sprintf"%%%02x",ord($1)}eg; print "$u"; ' "$head") - head=$(curl -nsfL $curl_extra_args "$remote/$remote_name_quoted") + head=$(curl -nsfL $curl_extra_args $noepsv_opt "$remote/$remote_name_quoted") depth=$( expr \( $depth + 1 \) ) done expr "z$head" : "z$_x40\$" >/dev/null || -- cgit v1.2.3