From: Brandon Williams Date: Fri, 05 Jan 2018 23:55:59 GMT Subject: Re: [PATCH 20/26] fetch-pack: perform a fetch using v2 Message-ID: <20180105235559.GC172942@google.com> In-Reply-To: On 01/03, Stefan Beller wrote: > On Tue, Jan 2, 2018 at 4:18 PM, Brandon Williams wrote: > > + > > +#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