From 2e27bd7731d47b374c1c14b53af07b3bfa39fcac Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Fri, 6 Apr 2018 19:09:38 +0000 Subject: treewide: replace maybe_tree with accessor methods In anticipation of making trees load lazily, create a Coccinelle script (contrib/coccinelle/commit.cocci) to ensure that all references to the 'maybe_tree' member of struct commit are either mutations or accesses through get_commit_tree() or get_commit_tree_oid(). Apply the Coccinelle script to create the rest of the patch. Signed-off-by: Derrick Stolee Signed-off-by: Junio C Hamano --- merge-recursive.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'merge-recursive.c') diff --git a/merge-recursive.c b/merge-recursive.c index 0f75d75d17..8de6e36527 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -2154,8 +2154,8 @@ int merge_recursive(struct merge_options *o, read_cache(); o->ancestor = "merged common ancestors"; - clean = merge_trees(o, h1->maybe_tree, h2->maybe_tree, - merged_common_ancestors->maybe_tree, + clean = merge_trees(o, get_commit_tree(h1), get_commit_tree(h2), + get_commit_tree(merged_common_ancestors), &mrtree); if (clean < 0) { flush_output(o); -- cgit v1.2.3