Currently usage of curl was so that netrc was mandatory and passwords in URL
weren't allowed. Change netrc to optional to make HTTP basic authentication
with username and password in URL also work.
Here's an example of such URL:
http://foo:bar@www.example.com/auth.git/
Signed-off-by: Kalle Valo <redacted>
---
git-clone.sh | 2 +-
git-fetch.sh | 2 +-
git-ls-remote.sh | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
applies-to: 8839be40e9401452691ae1b0bf4c86ac616b7bb6
43a79922ab5d3468f0e8614d526b693772d8b1d6
diff --git a/git-clone.sh b/git-clone.sh
index c09979a..8af0d5f 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -23,7 +23,7 @@ fi
http_fetch () {
# $1 = Remote, $2 = Local
- curl -nsfL $curl_extra_args "$1" >"$2"
+ curl -sfL --netrc-optional $curl_extra_args "$1" >"$2"
}
clone_dumb_http () {diff --git a/git-fetch.sh b/git-fetch.sh
index 6586e77..e983cef 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -234,7 +234,7 @@ do
$u =~ s{([^-a-zA-Z0-9/.])}{sprintf"%%%02x",ord($1)}eg;
print "$u";
' "$remote_name")
- head=$(curl -nsfL $curl_extra_args "$remote/$remote_name_quoted") &&
+ head=$(curl -sfL --netrc-optional $curl_extra_args "$remote/$remote_name_quoted") &&
expr "$head" : "$_x40\$" >/dev/null ||
die "Failed to fetch $remote_name from $remote"
echo >&2 Fetching "$remote_name from $remote" using httpdiff --git a/git-ls-remote.sh b/git-ls-remote.sh
index f0f0b07..af8f4b1 100755
--- a/git-ls-remote.sh
+++ b/git-ls-remote.sh
@@ -42,7 +42,7 @@ http://* | https://* )
if [ -n "$GIT_SSL_NO_VERIFY" ]; then
curl_extra_args="-k"
fi
- curl -nsf $curl_extra_args "$peek_repo/info/refs" ||
+ curl -sf --netrc-optional $curl_extra_args "$peek_repo/info/refs" ||
echo "failed slurping"
;;
---
0.99.9.GIT