Re: [PATCH 20/26] fetch-pack: perform a fetch using v2
- From
- Brandon Williams <bmwill@google.com>
- Date
- Jan 5, 2018, 23:55 UTC
- Message-ID
- <20180105235559.GC172942@google.com>
- In-Reply-To
- <CAGZ79kbM4Jk=aHJu7+U3AcgFMh0-jbbu4RPLUkKwM0mDWge+gA@mail.gmail.com>
On 01/03, Stefan Beller wrote:
Show 20 quoted lines
> On Tue, Jan 2, 2018 at 4:18 PM, Brandon Williams <bmwill@google.com> 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