diff options
author | Junio C Hamano <junkio@cox.net> | 2006-04-26 17:23:51 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-04-26 17:23:51 -0700 |
commit | f996fbf8a09d54cb293cdbc05713ca6a4678740a (patch) | |
tree | 7e8fe4100153c85be6df899ad1522ee3628030b0 /git-fetch.sh | |
parent | Merge branch 'jc/cache-tree' into next (diff) | |
parent | git-fetch: resolve remote symrefs for HTTP transport (diff) | |
download | tgif-f996fbf8a09d54cb293cdbc05713ca6a4678740a.tar.xz |
Merge branch 'nh/fetch-http' into next
* nh/fetch-http:
git-fetch: resolve remote symrefs for HTTP transport
commit-tree.c: check_valid() microoptimization.
Fix filename verification when in a subdirectory
rebase: typofix.
socksetup: don't return on set_reuse_addr() error
Diffstat (limited to 'git-fetch.sh')
-rwxr-xr-x | git-fetch.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/git-fetch.sh b/git-fetch.sh index 83143f82cf..280f62e4b7 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -270,14 +270,22 @@ fetch_main () { if [ -n "$GIT_SSL_NO_VERIFY" ]; then curl_extra_args="-k" fi - remote_name_quoted=$(perl -e ' + max_depth=5 + depth=0 + head="ref: $remote_name" + while (expr "z$head" : "zref:" && expr $depth \< $max_depth) >/dev/null + do + remote_name_quoted=$(perl -e ' my $u = $ARGV[0]; + $u =~ s/^ref:\s*//; $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") + head=$(curl -nsfL $curl_extra_args "$remote/$remote_name_quoted") + depth=$( expr \( $depth + 1 \) ) + done expr "z$head" : "z$_x40\$" >/dev/null || - die "Failed to fetch $remote_name from $remote" + die "Failed to fetch $remote_name from $remote" echo >&2 Fetching "$remote_name from $remote" using http git-http-fetch -v -a "$head" "$remote/" || exit ;; |