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 curl
-nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||
57 echo "failed slurping"
62 rsync
-rlq "$peek_repo/HEAD" $tmpdir &&
63 rsync
-rq "$peek_repo/refs" $tmpdir ||
{
64 echo "failed slurping"
67 head=$
(cat "$tmpdir/HEAD") &&
70 head=$
(expr "z$head" : 'zref: \(.*\)') &&
71 head=$
(cat "$tmpdir/$head") ||
exit
74 (cd $tmpdir && find refs
-type f
) |
77 cat "$tmpdir/$path" |
tr -d '\012'
84 git-peek-remote
$exec "$peek_repo" ||
85 echo "failed slurping"
93 die
"Failed to find remote refs"
103 case ",$heads,$tags,$other," in