Merge branch 'jc/clone-bind-failure'
authorJunio C Hamano <junkio@cox.net>
Tue, 25 Jul 2006 20:19:54 +0000 (13:19 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 25 Jul 2006 20:19:54 +0000 (13:19 -0700)
* jc/clone-bind-failure:
fetch/clone: check return status from ls-remote

1  2 
git-fetch.sh
diff --combined git-fetch.sh
index f7167abdf09c815fc8614b47ded0c6bc4518d6f8,0c7a11d5658e29dcf1036afb4db4020226b8e033..c2eebee798d10f7ed5977fc4e56cf02731031971
@@@ -20,7 -20,6 +20,7 @@@ verbose
  update_head_ok=
  exec=
  upload_pack=
 +keep=--thin
  while case "$#" in 0) break ;; esac
  do
        case "$1" in
@@@ -70,8 -69,7 +70,8 @@@ case "$#" i
  0)
        test -f "$GIT_DIR/branches/origin" ||
                test -f "$GIT_DIR/remotes/origin" ||
 -                      die "Where do you want to fetch from today?"
 +                      git-repo-config --get remote.origin.url >/dev/null ||
 +                              die "Where do you want to fetch from today?"
        set origin ;;
  esac
  
@@@ -155,7 -153,7 +155,7 @@@ fast_forward_local () 
        then
                if now_=$(cat "$GIT_DIR/$1") && test "$now_" = "$2"
                then
 -                      [ "$verbose" ] && echo >&2 "* $1: same as $3"
 +                      [ "$verbose" ] && echo >&2 "* $1: same as $3" ||:
                else
                        echo >&2 "* $1: updating with $3"
                        git-update-ref -m "$rloga: updating tag" "$1" "$2"
@@@ -225,9 -223,16 +225,16 @@@ reflist=$(get_remote_refs_for_fetch "$@
  if test "$tags"
  then
        taglist=`IFS="  " &&
-                 git-ls-remote $upload_pack --tags "$remote" |
+                 (
+                       git-ls-remote $upload_pack --tags "$remote" ||
+                       echo fail ouch
+                 ) |
                  while read sha1 name
                  do
+                       case "$sha1" in
+                       fail)
+                               exit 1
+                       esac
                        case "$name" in
                        *^*) continue ;;
                        esac
                        else
                            echo >&2 "warning: tag ${name} ignored"
                        fi
-                 done`
+                 done` || exit
        if test "$#" -gt 1
        then
                # remote URL plus explicit refspecs; we need to merge them.
@@@ -349,7 -354,7 +356,7 @@@ fetch_main () 
      ( : subshell because we muck with IFS
        IFS="   $LF"
        (
 -        git-fetch-pack $exec $keep --thin "$remote" $rref || echo failed "$remote"
 +        git-fetch-pack $exec $keep "$remote" $rref || echo failed "$remote"
        ) |
        while read sha1 remote_name
        do