Re: [PATCH 20/26] fetch-pack: perform a fetch using v2
From: Brandon Williams <hidden>
Date: 2018-01-05 23:56:07
From: Brandon Williams <hidden>
Date: 2018-01-05 23:56:07
On 01/03, Stefan Beller wrote:
On Tue, Jan 2, 2018 at 4:18 PM, Brandon Williams [off-list ref] wrote:quoted
+ +#define FETCH_CHECK_LOCAL 0 +#define FETCH_SEND_REQUEST 1 +#define FETCH_PROCESS_ACKS 2 +#define FETCH_SEND_HAVES 3 +#define FETCH_GET_PACK 4 +#define FETCH_DONE 5 + +static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args, + int fd[2], + const struct ref *orig_ref, + struct ref **sought, int nr_sought, + char **pack_lockfile) +{ + struct ref *ref = copy_ref_list(orig_ref); + int state = FETCH_CHECK_LOCAL;Is there any reason to use #defines over an enum here?
No, it would probably be better to use an enum, that would also get rid of the default case of the switch statement. -- Brandon Williams