From: Michael Haggerty Date: Sun, 09 Sep 2012 06:19:46 GMT Subject: [PATCH v3 11/14] cmd_fetch_pack(): return early if finish_connect() fails Message-ID: <1347171589-13327-12-git-send-email-mhagger@alum.mit.edu> In-Reply-To: <1347171589-13327-1-git-send-email-mhagger@alum.mit.edu> This simplifies the logic without changing the behavior. Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 056ccb8..fb2a423 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 -- 1.7.11.3