Skip to content

Commit f297424

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1ca13dd commit f297424

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

unpack-trees.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,6 +1876,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
18761876
BUG("o->internal.dir is for internal use only");
18771877
if (o->internal.pl)
18781878
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");
18791881

18801882
trace_performance_enter();
18811883
trace2_region_enter("unpack_trees", "unpack_trees", the_repository);

unpack-trees.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct unpack_trees_options {
7878

7979
int head_idx;
8080

81-
struct cache_entry *df_conflict_entry;
81+
struct cache_entry *df_conflict_entry; /* output only */
8282
void *unpack_data;
8383

8484
struct index_state *dst_index;

0 commit comments

Comments
 (0)