summaryrefslogtreecommitdiff
path: root/builtin/fetch-pack.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-09-09 06:19:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-09-12 18:46:31 (GMT)
commit7418f1a0371fd935de6cbe718bbdd567070e9d17 (patch)
treed84220ee540ef76c1a4b16dd8916608439eba6ed /builtin/fetch-pack.c
parentf537cfa7501de5e4dcdac55a95515e9a2ff880e3 (diff)
downloadgit-7418f1a0371fd935de6cbe718bbdd567070e9d17.zip
git-7418f1a0371fd935de6cbe718bbdd567070e9d17.tar.gz
git-7418f1a0371fd935de6cbe718bbdd567070e9d17.tar.bz2
cmd_fetch_pack(): return early if finish_connect() fails
This simplifies the logic without changing the behavior. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch-pack.c')
-rw-r--r--builtin/fetch-pack.c6
1 files 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