tutorial: use "project history" instead of "changelog" in header
[gitweb.git] / git-clone.sh
index 1bd54ded3c424db30ca46b00b3ed42b4d774d21d..fdd354f2da1978241a3e79a47a067496150cc1bc 100755 (executable)
@@ -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