summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-23 05:38:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-23 05:38:13 (GMT)
commitc89b6e136e421f1e9108b3c5bc050b19b0243844 (patch)
tree8d81e022f855aad5d29853b56b886d3c6b382c45 /sequencer.c
parent05682ee270199fdfbc11883458b3639b2b1577df (diff)
parent279ffad17dcc3b72aa7cb5c73fb7aa8eddeed9da (diff)
downloadgit-c89b6e136e421f1e9108b3c5bc050b19b0243844.zip
git-c89b6e136e421f1e9108b3c5bc050b19b0243844.tar.gz
git-c89b6e136e421f1e9108b3c5bc050b19b0243844.tar.bz2
Merge branch 'ds/lazy-load-trees'
The code has been taught to use the duplicated information stored in the commit-graph file to learn the tree object name for a commit to avoid opening and parsing the commit object when it makes sense to do so. * ds/lazy-load-trees: coccinelle: avoid wrong transformation suggestions from commit.cocci commit-graph: lazy-load trees for commits treewide: replace maybe_tree with accessor methods commit: create get_commit_tree() method treewide: rename tree to maybe_tree
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sequencer.c b/sequencer.c
index 4ce5120..2f69f5a 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -500,8 +500,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
o.show_rename_progress = 1;
head_tree = parse_tree_indirect(head);
- next_tree = next ? next->tree : empty_tree();
- base_tree = base ? base->tree : empty_tree();
+ next_tree = next ? get_commit_tree(next) : empty_tree();
+ base_tree = base ? get_commit_tree(base) : empty_tree();
for (xopt = opts->xopts; xopt != opts->xopts + opts->xopts_nr; xopt++)
parse_merge_opt(&o, *xopt);
@@ -562,7 +562,7 @@ static int is_index_unchanged(void)
return error(_("unable to update cache tree"));
return !oidcmp(&active_cache_tree->oid,
- &head_commit->tree->object.oid);
+ get_commit_tree_oid(head_commit));
}
static int write_author_script(const char *message)
@@ -1119,7 +1119,7 @@ static int try_to_commit(struct strbuf *msg, const char *author,
}
if (!(flags & ALLOW_EMPTY) && !oidcmp(current_head ?
- &current_head->tree->object.oid :
+ get_commit_tree_oid(current_head) :
&empty_tree_oid, &tree)) {
res = 1; /* run 'git commit' to display error message */
goto out;
@@ -1219,12 +1219,12 @@ static int is_original_commit_empty(struct commit *commit)
if (parse_commit(parent))
return error(_("could not parse parent commit %s"),
oid_to_hex(&parent->object.oid));
- ptree_oid = &parent->tree->object.oid;
+ ptree_oid = get_commit_tree_oid(parent);
} else {
ptree_oid = the_hash_algo->empty_tree; /* commit is root */
}
- return !oidcmp(ptree_oid, &commit->tree->object.oid);
+ return !oidcmp(ptree_oid, get_commit_tree_oid(commit));
}
/*