@matheusbsbs / matheus-bagliano / commits / 57a39690b9
Fork 0

fetch/clone: check return status from ls-remote

Some callers of ls-remote did not check its return status.

Junio C Hamano committed Jul 10, 2006 at 03:34 UTC 57a39690b936c003662b6710241732b980e58790
2 files changed +11 -4
git-clone.sh
+2 -2
@@ -266,7 +266,7 @@ yes,yes)
266 echo "$repo/objects" >> "$GIT_DIR/objects/info/alternates"
267 ;;
268 esac
269 - git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD"
269 + git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
270 ;;
271 *)
272 case "$repo" in
@@ -296,7 +296,7 @@ yes,yes)
296 done
297 rm -f "$GIT_DIR/TMP_ALT"
298 fi
299 - git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD"
299 + git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1
300 ;;
301 http://*)
302 if test -z "@@NO_CURL@@"
git-fetch.sh
+9 -2
@@ -223,9 +223,16 @@ reflist=$(get_remote_refs_for_fetch "$@")
223 if test "$tags"
224 then
225 taglist=`IFS=" " &&
226 - git-ls-remote $upload_pack --tags "$remote" |
226 + (
227 + git-ls-remote $upload_pack --tags "$remote" ||
228 + echo fail ouch
229 + ) |
230 while read sha1 name
231 do
232 + case "$sha1" in
233 + fail)
234 + exit 1
235 + esac
236 case "$name" in
237 *^*) continue ;;
238 esac
@@ -235,7 +242,7 @@ then
242 else
243 echo >&2 "warning: tag ${name} ignored"
244 fi
238 - done`
245 + done` || exit
246 if test "$#" -gt 1
247 then
248 # remote URL plus explicit refspecs; we need to merge them.