diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2018-04-06 22:09:38 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-11 04:47:16 +0300 |
commit | 2e27bd7731d47b374c1c14b53af07b3bfa39fcac (patch) | |
tree | c7635d69f1c20bfb0d3a61feebcedca13d9161ad /log-tree.c | |
parent | 5bb03de102b40d9e564be3a3a39084a550db79cb (diff) |
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 <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'log-tree.c')
-rw-r--r-- | log-tree.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/log-tree.c b/log-tree.c index 99499af57c..c106bd70df 100644 --- a/log-tree.c +++ b/log-tree.c @@ -806,7 +806,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log return 0; parse_commit_or_die(commit); - oid = &commit->maybe_tree->object.oid; + oid = get_commit_tree_oid(commit); /* Root commit? */ parents = get_saved_parents(opt, commit); @@ -831,7 +831,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log * we merged _in_. */ parse_commit_or_die(parents->item); - diff_tree_oid(&parents->item->maybe_tree->object.oid, + diff_tree_oid(get_commit_tree_oid(parents->item), oid, "", &opt->diffopt); log_tree_diff_flush(opt); return !opt->loginfo; @@ -846,7 +846,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log struct commit *parent = parents->item; parse_commit_or_die(parent); - diff_tree_oid(&parent->maybe_tree->object.oid, + diff_tree_oid(get_commit_tree_oid(parent), oid, "", &opt->diffopt); log_tree_diff_flush(opt); |