From: Michael Haggerty Date: Sun, 9 Sep 2012 06:19:46 +0000 (+0200) Subject: cmd_fetch_pack(): return early if finish_connect() fails X-Git-Tag: v1.8.0-rc0~30^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7418f1a0371fd935de6cbe718bbdd567070e9d17;p=git.git cmd_fetch_pack(): return early if finish_connect() fails This simplifies the logic without changing the behavior. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 056ccb866..fb2a423b5 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -1018,10 +1018,10 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) close(fd[0]); close(fd[1]); if (finish_connect(conn)) - ref = NULL; - ret = !ref; + return 1; - if (!ret && sought.nr) { + ret = !ref; + if (ref && sought.nr) { /* If the heads to pull were given, we should have * consumed all of them by matching the remote. * Otherwise, 'git fetch remote no-such-ref' would