X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-clone.sh;h=fdd354f2da1978241a3e79a47a067496150cc1bc;hb=9840906026be807d0882f96396de3a3cdb9fb43e;hp=1bd54ded3c424db30ca46b00b3ed42b4d774d21d;hpb=099c7837678361985ca9df1240cdaf6a42fc89f9;p=git.git diff --git a/git-clone.sh b/git-clone.sh index 1bd54ded3..fdd354f2d 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -18,7 +18,14 @@ usage() { } get_repo_base() { - (cd "$1" && (cd .git ; pwd)) 2> /dev/null + ( + cd "`/bin/pwd`" && + cd "$1" && + { + cd .git + pwd + } + ) 2>/dev/null } if [ -n "$GIT_SSL_NO_VERIFY" ]; then @@ -42,6 +49,7 @@ clone_dumb_http () { http_fetch "$1/info/refs" "$clone_tmp/refs" || die "Cannot get remote repository information. Perhaps git-update-server-info needs to be run there?" + test "z$quiet" = z && v=-v || v= while read sha1 refname do name=`expr "z$refname" : 'zrefs/\(.*\)'` && @@ -59,7 +67,7 @@ Perhaps git-update-server-info needs to be run there?" else tname=$name fi - git-http-fetch -v -a -w "$tname" "$name" "$1/" || exit 1 + git-http-fetch $v -a -w "$tname" "$sha1" "$1" || exit 1 done <"$clone_tmp/refs" rm -fr "$clone_tmp" http_fetch "$1/HEAD" "$GIT_DIR/REMOTE_HEAD" || @@ -79,6 +87,8 @@ origin= origin_override= use_separate_remote=t depth= +no_progress= +test -t 1 || no_progress=--no-progress while case "$#,$1" in 0,*) break ;; @@ -290,8 +300,8 @@ yes,yes) ;; *) case "$upload_pack" in - '') git-fetch-pack --all -k $quiet $depth "$repo" ;; - *) git-fetch-pack --all -k $quiet "$upload_pack" $depth "$repo" ;; + '') git-fetch-pack --all -k $quiet $depth $no_progress "$repo";; + *) git-fetch-pack --all -k $quiet "$upload_pack" $depth $no_progress "$repo" ;; esac >"$GIT_DIR/CLONE_HEAD" || die "fetch-pack from '$repo' failed." ;; @@ -393,7 +403,7 @@ then case "$no_checkout" in '') - test "z$quiet" = z && v=-v || v= + test "z$quiet" = z -a "z$no_progress" = z && v=-v || v= git-read-tree -m -u $v HEAD HEAD esac fi