unpack-trees: add usage notices around df_conflict_entry
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>
Elijah Newren committed
Feb 27, 2023 at 15:28 UTC
f297424a3a02b552865798ac8367cf657ef1df2d
2 files changed
+3
-1
unpack-trees.c
+2
@@ -1876,6 +1876,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
1876
BUG("o->internal.dir is for internal use only");
1877
if (o->internal.pl)
1878
BUG("o->internal.pl is for internal use only");
1879
+ if (o->df_conflict_entry)
1880
+ BUG("o->df_conflict_entry is an output only field");
1881
1882
trace_performance_enter();
1883
trace2_region_enter("unpack_trees", "unpack_trees", the_repository);
unpack-trees.h
+1
-1
@@ -78,7 +78,7 @@ struct unpack_trees_options {
78
79
int head_idx;
80
81
- struct cache_entry *df_conflict_entry;
81
+ struct cache_entry *df_conflict_entry; /* output only */
82
void *unpack_data;
83
84
struct index_state *dst_index;