Propagate errors from fetch-pack correctly to git-fetch.
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>
This commit is contained in:
parent
365527adbf
commit
22c67ca88e
11
git-fetch.sh
11
git-fetch.sh
@ -205,9 +205,16 @@ case "$remote" in
|
|||||||
http://* | https://* | rsync://* )
|
http://* | https://* | rsync://* )
|
||||||
;; # we are already done.
|
;; # we are already done.
|
||||||
*)
|
*)
|
||||||
git-fetch-pack "$remote" $rref |
|
(
|
||||||
|
git-fetch-pack "$remote" $rref || echo failed "$remote"
|
||||||
|
) |
|
||||||
while read sha1 remote_name
|
while read sha1 remote_name
|
||||||
do
|
do
|
||||||
|
case "$sha1" in
|
||||||
|
failed)
|
||||||
|
echo >&2 "Fetch failure: $remote"
|
||||||
|
exit 1 ;;
|
||||||
|
esac
|
||||||
found=
|
found=
|
||||||
single_force=
|
single_force=
|
||||||
for ref in $refs
|
for ref in $refs
|
||||||
@ -225,7 +232,7 @@ http://* | https://* | rsync://* )
|
|||||||
|
|
||||||
local_name=$(expr "$found" : '[^:]*:\(.*\)')
|
local_name=$(expr "$found" : '[^:]*:\(.*\)')
|
||||||
append_fetch_head "$sha1" "$remote" "$remote_name" "$remote_nick" "$local_name"
|
append_fetch_head "$sha1" "$remote" "$remote_name" "$remote_nick" "$local_name"
|
||||||
done
|
done || exit
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user