diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-05-23 14:38:13 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-23 14:38:13 +0900 |
commit | c89b6e136e421f1e9108b3c5bc050b19b0243844 (patch) | |
tree | 8d81e022f855aad5d29853b56b886d3c6b382c45 /notes-merge.c | |
parent | 05682ee270199fdfbc11883458b3639b2b1577df (diff) | |
parent | 279ffad17dcc3b72aa7cb5c73fb7aa8eddeed9da (diff) | |
download | git-c89b6e136e421f1e9108b3c5bc050b19b0243844.tar.gz |
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 'notes-merge.c')
-rw-r--r-- | notes-merge.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/notes-merge.c b/notes-merge.c index 8e0726a941..e06d71ea47 100644 --- a/notes-merge.c +++ b/notes-merge.c @@ -600,14 +600,14 @@ int notes_merge(struct notes_merge_options *o, printf("No merge base found; doing history-less merge\n"); } else if (!bases->next) { base_oid = &bases->item->object.oid; - base_tree_oid = &bases->item->tree->object.oid; + base_tree_oid = get_commit_tree_oid(bases->item); if (o->verbosity >= 4) printf("One merge base found (%.7s)\n", oid_to_hex(base_oid)); } else { /* TODO: How to handle multiple merge-bases? */ base_oid = &bases->item->object.oid; - base_tree_oid = &bases->item->tree->object.oid; + base_tree_oid = get_commit_tree_oid(bases->item); if (o->verbosity >= 3) printf("Multiple merge bases found. Using the first " "(%.7s)\n", oid_to_hex(base_oid)); @@ -634,8 +634,9 @@ int notes_merge(struct notes_merge_options *o, goto found_result; } - result = merge_from_diffs(o, base_tree_oid, &local->tree->object.oid, - &remote->tree->object.oid, local_tree); + result = merge_from_diffs(o, base_tree_oid, + get_commit_tree_oid(local), + get_commit_tree_oid(remote), local_tree); if (result != 0) { /* non-trivial merge (with or without conflicts) */ /* Commit (partial) result */ |