3 . git-sh-setup-script || die
"Not a git archive"
6 echo >&2 "usage: $0 [--heads] [--tags] [--overwrite | --store] repo"
10 while case "$#" in 0) break;; esac
13 -h|
--h|
--he|
--hea|
--head|
--heads)
15 -o|
--o|
--ov|
--ove|
--over|
--overw|
--overwr|
--overwri|
--overwrit|
--overwrite)
16 overwrite
=overwrite
; shift ;;
17 -s|
--s|
--st|
--sto|
--stor|
--store)
19 -t|
--t|
--ta|
--tag|
--tags)
30 case "$#" in 1) ;; *) usage
;; esac
31 case ",$store,$overwrite," in *,,*) ;; *) usage
;; esac
33 case ",$heads,$tags," in
34 ,,,) heads
=heads tags
=tags other
=other
;;
37 . git-parse-remote
"$@"
38 peek_repo
="$_remote_repo"
41 trap "rm -fr $tmp-*" 0 1 2 3 15
45 http
://* | https
://* )
46 if [ -n "$GIT_SSL_NO_VERIFY" ]; then
49 curl
-ns $curl_extra_args "$peek_repo/info/refs" ||
exit 1
54 rsync
-rq "$peek_repo/refs" $tmpdir ||
exit 1
55 (cd $tmpdir && find refs
-type f
) |
58 cat "$tmpdir/$path" |
tr -d '\012'
65 git-peek-remote
"$peek_repo"
79 case ",$heads,$tags,$other," in
88 case "$path,$store,$overwrite," in
89 *,,, | HEAD
,*) continue ;;
92 if test -f "$GIT_DIR/$path" && test "$overwrite" == ""
97 # Be careful. We may not have that object yet!
98 if git-cat-file
-t "$sha1" >/dev
/null
2>&1
100 echo "$sha1" >"$GIT_DIR/$path"
102 echo >&2 "* You have not fetched updated $path ($sha1)."