diff options
author | Junio C Hamano <junkio@cox.net> | 2005-09-12 22:20:02 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-09-12 22:52:52 -0700 |
commit | 22c67ca88ec65c4f278e8c82b2d98f3bd025238b (patch) | |
tree | b66a5d2497295dc3eb623c6170ef8ac34e44c7f5 /git-fetch.sh | |
parent | 365527adbfa8a16dfc05ab71818602f55ada55ba (diff) | |
download | git-22c67ca88ec65c4f278e8c82b2d98f3bd025238b.tar.gz |
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>
Diffstat (limited to 'git-fetch.sh')
-rwxr-xr-x | git-fetch.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/git-fetch.sh b/git-fetch.sh index 673a184179..2273944038 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -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 @@ -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 |