Documentation/git-add: clarify -u with path limiting
[gitweb.git] / git-clone.sh
index 1bd54ded3c424db30ca46b00b3ed42b4d774d21d..70374aaaf0f766588739053becc36831381d4f35 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 2>/dev/null
+                       pwd
+               }
+       )
 }
 
 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