This makes it more obvious that the code is always executed unless
there is an error, and that the first initialization of nr_heads is
unnecessary.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
packet_trace_identity("fetch-pack");
- nr_heads = 0;
heads = NULL;
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
}
usage(fetch_pack_usage);
}
- dest = arg;
- heads = (char **)(argv + i + 1);
- nr_heads = argc - i - 1;
break;
}
- if (!dest)
+
+ if (i < argc)
+ dest = argv[i++];
+ else
usage(fetch_pack_usage);
+ heads = (char **)(argv + i);
+ nr_heads = argc - i;
+
if (args.stdin_refs) {
/*
* Copy refs from cmdline to new growable list, then