Re: [PATCH v2 13/20] merge-ort: step 1 of tree writing -- record basenames, modes, and oids
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Nov 11, 2020, 20:01 UTC
- Message-ID
- <20201111200157.3118955-1-jonathantanmy@google.com>
- In-Reply-To
- <20201102204344.342633-14-newren@gmail.com>
> +struct directory_versions {
> + struct string_list versions;Maybe comment that this is an unordered list of basenames to <whatever the type of ci->merged.result is>.
Show 15 quoted lines
> @@ -442,6 +464,7 @@ static void process_entries(struct merge_options *opt,
> struct strmap_entry *e;
> struct string_list plist = STRING_LIST_INIT_NODUP;
> struct string_list_item *entry;
> + struct directory_versions dir_metadata;
>
> if (strmap_empty(&opt->priv->paths)) {
> oidcpy(result_oid, opt->repo->hash_algo->empty_tree);
> @@ -458,6 +481,9 @@ static void process_entries(struct merge_options *opt,
> plist.cmp = string_list_df_name_compare;
> string_list_sort(&plist);
>
> + /* other setup */
> + string_list_init(&dir_metadata.versions, 0);
> +Might be clearer to just initialize dir_metadata as { STRING_LIST_INIT_NODUP }.
The rest makes sense.