5 echo >&2 "usage: $0 [--heads] [--tags] [-u|--upload-pack <upload-pack>]"
6 echo >&2 " <repository> <refs>..."
16 while case "$#" in 0) break;; esac
19 -h|--h|--he|--hea|--head|--heads)
21 -t|--t|--ta|--tag|--tags)
23 -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\
24 --upload-pac|--upload-pack)
37 case "$#" in 0) usage ;; esac
39 case ",$heads,$tags," in
40 ,,,) heads=heads tags=tags other=other ;;
44 peek_repo="$(get_remote_url "$@")"
48 trap "rm -fr $tmp-*" 0 1 2 3 15
52 http://* | https://* | ftp://* )
53 if [ -n "$GIT_SSL_NO_VERIFY" ]; then
56 if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
57 "`git-repo-config --bool http.noEPSV`" = true ]; then
58 curl_extra_args="${curl_extra_args} --disable-epsv"
60 curl -nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||
61 echo "failed slurping"
66 rsync -rlq "$peek_repo/HEAD" $tmpdir &&
67 rsync -rq "$peek_repo/refs" $tmpdir || {
68 echo "failed slurping"
71 head=$(cat "$tmpdir/HEAD") &&
74 head=$(expr "z$head" : 'zref: \(.*\)') &&
75 head=$(cat "$tmpdir/$head") || exit
78 (cd $tmpdir && find refs -type f) |
81 cat "$tmpdir/$path" | tr -d '\012'
88 git-peek-remote $exec "$peek_repo" ||
89 echo "failed slurping"
97 die "Failed to find remote refs"
107 case ",$heads,$tags,$other," in