Re: [PATCH v2 22/43] refs-be-files.c: add do_for_each_per_worktree_ref
On 09/29/2015 12:01 AM, David Turner wrote:
Show 36 quoted lines
> Alternate refs backends might still use files to store per-worktree
> refs. So the files backend's ref-loading infrastructure should be
> available to those backends, just for use on per-worktree refs. Add
> do_for_each_per_worktree_ref, which iterates over per-worktree refs.
>
> Signed-off-by: David Turner <dturner@twopensource.com>
> ---
> refs-be-files.c | 15 ++++++++++++---
> refs.h | 11 +++++++++++
> 2 files changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/refs-be-files.c b/refs-be-files.c
> index eb18a20..dc89289 100644
> --- a/refs-be-files.c
> +++ b/refs-be-files.c
> @@ -587,9 +587,6 @@ static void sort_ref_dir(struct ref_dir *dir)
> dir->sorted = dir->nr = i;
> }
>
> -/* Include broken references in a do_for_each_ref*() iteration: */
> -#define DO_FOR_EACH_INCLUDE_BROKEN 0x01
> -
> /*
> * Return true iff the reference described by entry can be resolved to
> * an object in the database. Emit a warning if the referred-to
> [...]
> diff --git a/refs.h b/refs.h
> index 5875fe5..09d140d 100644
> --- a/refs.h
> +++ b/refs.h
> @@ -152,6 +152,12 @@ struct ref_transaction;
> */
> #define REF_BAD_NAME 0x08
>
> +/* Include broken references in a do_for_each_ref*() iteration */
> +#define DO_FOR_EACH_INCLUDE_BROKEN 0x01
Why do you move this definition from refs-be-files.c?
> +
> +/* Only include per-worktree refs in a do_for_each_ref*() iteration */
> +#define DO_FOR_EACH_PER_WORKTREE_ONLY 0x02
And why do you define this one here instead of in refs-be-files.c?
> [...]
--
Michael Haggerty
mhagger@alum.mit.edu