1. Stefan Saasen
  2. git

Commits

Junio C Hamano  committed 09f5dc4 Merge

Merge branch 'jc/clone-bind-failure'

* jc/clone-bind-failure:
fetch/clone: check return status from ls-remote

  • Participants
  • Parent commits e79992a, 57a3969
  • Branches master

Comments (0)

Files changed (2)

File git-clone.sh

View file
 	    echo "$repo/objects" >> "$GIT_DIR/objects/info/alternates"
 	    ;;
 	esac
-	git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD"
+	git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
 	;;
 *)
 	case "$repo" in
 		    done
 		    rm -f "$GIT_DIR/TMP_ALT"
 		fi
-		git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD"
+		git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
 		;;
 	http://*)
 		if test -z "@@NO_CURL@@"

File git-fetch.sh

View file
 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.