Skip to content

Commit

Permalink
Propagate errors from fetch-pack correctly to git-fetch.
Browse files Browse the repository at this point in the history
When git-fetch-pack fails, the command does not notice the failure
and instead pretended nothing was fetched and there was nothing wrong.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Sep 13, 2005
1 parent 365527a commit 22c67ca
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions git-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,16 @@ case "$remote" in
http://* | https://* | rsync://* )
;; # we are already done.
*)
git-fetch-pack "$remote" $rref |
(
git-fetch-pack "$remote" $rref || echo failed "$remote"
) |
while read sha1 remote_name
do
case "$sha1" in
failed)
echo >&2 "Fetch failure: $remote"
exit 1 ;;
esac
found=
single_force=
for ref in $refs
Expand All @@ -225,7 +232,7 @@ http://* | https://* | rsync://* )

local_name=$(expr "$found" : '[^:]*:\(.*\)')
append_fetch_head "$sha1" "$remote" "$remote_name" "$remote_nick" "$local_name"
done
done || exit
;;
esac

Expand Down

0 comments on commit 22c67ca

Please sign in to comment.