]> git.ipfire.org Git - thirdparty/git.git/commitdiff
unpack-trees: add usage notices around df_conflict_entry
authorElijah Newren <newren@gmail.com>
Mon, 27 Feb 2023 15:28:20 +0000 (15:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2023 16:29:51 +0000 (08:29 -0800)
Avoid making users believe they need to initialize df_conflict_entry
to something (as happened with other output only fields before) with
a quick comment and a small sanity check.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
unpack-trees.c
unpack-trees.h

index 3e5f4bd2355f334b9f630c244e96122b310b88e0..a37ab292bbd911256dd8c72a9e1b0a50fa7918f0 100644 (file)
@@ -1876,6 +1876,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
                BUG("o->internal.dir is for internal use only");
        if (o->internal.pl)
                BUG("o->internal.pl is for internal use only");
+       if (o->df_conflict_entry)
+               BUG("o->df_conflict_entry is an output only field");
 
        trace_performance_enter();
        trace2_region_enter("unpack_trees", "unpack_trees", the_repository);
index e8737adfeda8f81ab56d23c66c45ba5de83d0331..61c06eb7c506e7753fd291a8a32539d2fc21496b 100644 (file)
@@ -78,7 +78,7 @@ struct unpack_trees_options {
 
        int head_idx;
 
-       struct cache_entry *df_conflict_entry;
+       struct cache_entry *df_conflict_entry; /* output only */
        void *unpack_data;
 
        struct index_state *dst_index;