From: Junio C Hamano Date: Thu, 24 Aug 2017 21:56:02 GMT Subject: Re: [PATCH v4 08/16] revision.c: use refs_for_each*() instead of for_each_*_submodule() Message-ID: In-Reply-To: <20170823123704.16518-9-pclouds@gmail.com> Nguyễn Thái Ngọc Duy writes: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- So... the idea is that the caller gives a ref-store and tells these functions to iterate over refs in it, and the existing submodule related callers can prepare a ref-store for the submodule---that way, refs.[ch] layer does not have to _care_ that the set of refs it was asked to look at is for submodule processing. Nice. Very nice. > @@ -2120,8 +2129,14 @@ static int handle_revision_pseudo_opt(const char *submodule, > { > const char *arg = argv[0]; > const char *optarg; > + struct ref_store *refs; > int argcount; > > + if (submodule) { > + refs = get_submodule_ref_store(submodule); > + } else > + refs = get_main_ref_store(); > +