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>
Michael Haggerty committed
Sep 9, 2012 at 08:19 UTC
7418f1a0371fd935de6cbe718bbdd567070e9d17
1 file changed
+3
-3
builtin/fetch-pack.c
+3
-3
@@ -1018,10 +1018,10 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
1018
close(fd[0]);
1019
close(fd[1]);
1020
if (finish_connect(conn))
1021
- ref = NULL;
1022
- ret = !ref;
1021
+ return 1;
1022
1024
- if (!ret && sought.nr) {
1023
+ ret = !ref;
1024
+ if (ref && sought.nr) {
1025
/* If the heads to pull were given, we should have
1026
* consumed all of them by matching the remote.
1027
* Otherwise, 'git fetch remote no-such-ref' would