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)
26 exec="--upload-pack=$1"
28 -u=*|
--u=*|
--up=*|
--upl=*|
--uplo=*|
--uploa=*|
--upload=*|\
29 --upload-=*|
--upload-p=*|
--upload-pa=*|
--upload-pac=*|
--upload-pack=*)
30 exec=--upload-pack=$
(expr "z$1" : 'z-[^=]*=\(.*\)')
41 case "$#" in 0) usage
;; esac
43 case ",$heads,$tags," in
44 ,,,) heads
=heads tags
=tags other
=other
;;
48 peek_repo
="$(get_remote_url "$@
")"
52 trap "rm -fr $tmp-*" 0 1 2 3 15
56 http
://* | https
://* |
ftp://* )
57 if [ -n "$GIT_SSL_NO_VERIFY" ]; then
60 if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
61 "`git config --bool http.noEPSV`" = true
]; then
62 curl_extra_args
="${curl_extra_args} --disable-epsv"
64 curl
-nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||
65 echo "failed slurping"
70 rsync
-rlq "$peek_repo/HEAD" $tmpdir &&
71 rsync
-rq "$peek_repo/refs" $tmpdir ||
{
72 echo "failed slurping"
75 head=$
(cat "$tmpdir/HEAD") &&
78 head=$
(expr "z$head" : 'zref: \(.*\)') &&
79 head=$
(cat "$tmpdir/$head") ||
exit
82 (cd $tmpdir && find refs
-type f
) |
85 tr -d '\012' <"$tmpdir/$path"
92 if test -f "$peek_repo" ; then
93 git bundle list-heads
"$peek_repo" ||
94 echo "failed slurping"
96 git peek-remote
$exec "$peek_repo" ||
97 echo "failed slurping"
116 case ",$heads,$tags,$other," in