Code

Bash completion support for aliases
[git.git] / git-fetch.sh
index 85e96a1cc7df5593600911b751bec361720c01a3..7dc1f33687279812605c7b6f9ddc13478e143058 100755 (executable)
@@ -296,6 +296,7 @@ fetch_main () {
       # There are transports that can fetch only one head at a time...
       case "$remote" in
       http://* | https://* | ftp://*)
+         proto=`expr "$remote" : '\([^:]*\):'`
          if [ -n "$GIT_SSL_NO_VERIFY" ]; then
              curl_extra_args="-k"
          fi
@@ -319,7 +320,7 @@ fetch_main () {
          done
          expr "z$head" : "z$_x40\$" >/dev/null ||
              die "Failed to fetch $remote_name from $remote"
-         echo >&2 Fetching "$remote_name from $remote" using http
+         echo >&2 "Fetching $remote_name from $remote using $proto"
          git-http-fetch -v -a "$head" "$remote/" || exit
          ;;
       rsync://*)
@@ -445,10 +446,10 @@ esac
 
 # If the original head was empty (i.e. no "master" yet), or
 # if we were told not to worry, we do not have to check.
-case ",$update_head_ok,$orig_head," in
-*,, | t,* )
+case "$orig_head" in
+'')
        ;;
-*)
+?*)
        curr_head=$(git-rev-parse --verify HEAD 2>/dev/null)
        if test "$curr_head" != "$orig_head"
        then