Skip to content

Commit

Permalink
unpack-trees: add usage notices around df_conflict_entry
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
newren committed Feb 25, 2023
1 parent 5af04d7 commit c4f3123
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions unpack-trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion unpack-trees.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c4f3123

Please sign in to comment.