5 echo >&2 "usage: $0 [--heads] [--tags] [-u|--upload-pack <upload-pack>]"
6 echo >&2 " <repository> <refs>..."
15 # Fix some commands on Windows
18 # Windows has its own (incompatible) sort and find
32 -h|
--h|
--he|
--hea|
--head|
--heads)
34 -t|
--t|
--ta|
--tag|
--tags)
36 -u|
--u|
--up|
--upl|
--uploa|
--upload|
--upload-|
--upload-p|
--upload-pa|\
37 --upload-pac|
--upload-pack)
39 exec="--upload-pack=$1"
41 -u=*|
--u=*|
--up=*|
--upl=*|
--uplo=*|
--uploa=*|
--upload=*|\
42 --upload-=*|
--upload-p=*|
--upload-pa=*|
--upload-pac=*|
--upload-pack=*)
43 exec=--upload-pack=$
(expr "z$1" : 'z-[^=]*=\(.*\)')
54 case "$#" in 0) usage
;; esac
56 case ",$heads,$tags," in
57 ,,,) heads
=heads tags
=tags other
=other
;;
61 peek_repo
="$(get_remote_url "$@
")"
65 trap "rm -fr $tmp-*" 0 1 2 3 15
69 http
://* | https
://* |
ftp://* )
70 if [ -n "$GIT_SSL_NO_VERIFY" -o \
71 "`git config --bool http.sslVerify`" = false
]; then
74 if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
75 "`git config --bool http.noEPSV`" = true
]; then
76 curl_extra_args
="${curl_extra_args} --disable-epsv"
78 curl
-nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||
79 echo "failed slurping"
84 rsync
-rlq "$peek_repo/HEAD" $tmpdir &&
85 rsync
-rq "$peek_repo/refs" $tmpdir ||
{
86 echo "failed slurping"
89 head=$
(cat "$tmpdir/HEAD") &&
92 head=$
(expr "z$head" : 'zref: \(.*\)') &&
93 head=$
(cat "$tmpdir/$head") ||
exit
96 (cd $tmpdir && find refs
-type f
) |
99 tr -d '\012' <"$tmpdir/$path"
106 if test -f "$peek_repo" ; then
107 git bundle list-heads
"$peek_repo" ||
108 echo "failed slurping"
110 git-peek-remote
$exec "$peek_repo" ||
111 echo "failed slurping"
130 case ",$heads,$tags,$other," in