diff --git a/git-fetch.sh b/git-fetch.sh index 8b46e73..6459994 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -21,7 +21,7 @@ update_head_ok= exec= upload_pack= keep= -depth= +depth=0 while case "$#" in 0) break ;; esac do case "$1" in @@ -304,7 +304,7 @@ fetch_main () { # There are transports that can fetch only one head at a time... case "$remote" in http://* | https://* | ftp://*) - test -n "$depth" && die "shallow clone with http not supported" + [ x"$depth" != x0 ] && die "shallow clone with http not supported" proto=`expr "$remote" : '\([^:]*\):'` if [ -n "$GIT_SSL_NO_VERIFY" ]; then curl_extra_args="-k" @@ -325,7 +325,7 @@ fetch_main () { print "$u"; ' "$head") head=$(curl -nsfL $curl_extra_args $noepsv_opt "$remote/$remote_name_quoted") - depth=$( expr \( $depth + 1 \) ) + # depth=$( expr \( $depth + 1 \) ) done expr "z$head" : "z$_x40\$" >/dev/null || die "Failed to fetch $remote_name from $remote" @@ -333,7 +333,7 @@ fetch_main () { git-http-fetch -v -a "$head" "$remote/" || exit ;; rsync://*) - test -n "$depth" && die "shallow clone with rsync not supported" + [ x"$depth" != x0 ] && die "shallow clone with http not supported" TMP_HEAD="$GIT_DIR/TMP_HEAD" rsync -L -q "$remote/$remote_name" "$TMP_HEAD" || exit 1 head=$(git-rev-parse --verify TMP_HEAD)