diff mbox series

[v3,2/9] tree: update cases to use repo_ tree methods

Message ID 2291e0f9b5c61f9668b206b85368829db9384bb3.1665973401.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series archive: Add --recurse-submodules to git-archive command | expand

Commit Message

Heather Lapointe Oct. 17, 2022, 2:23 a.m. UTC
From: Heather Lapointe <alpha@alphaservcomputing.solutions>

For cases which had already had a repository instance,
update those to use the repo_parse_tree* methods.

Leave the remaining invocations that were already using the_repository
alone.

Signed-off-by: Heather Lapointe <alpha@alphaservcomputing.solutions>
---
 merge.c     | 4 ++--
 reset.c     | 2 +-
 revision.c  | 4 ++--
 sequencer.c | 6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/merge.c b/merge.c
index 2382ff66d35..1efc4440c03 100644
--- a/merge.c
+++ b/merge.c
@@ -63,12 +63,12 @@  int checkout_fast_forward(struct repository *r,
 	memset(&trees, 0, sizeof(trees));
 	memset(&t, 0, sizeof(t));
 
-	trees[nr_trees] = parse_tree_indirect(head);
+	trees[nr_trees] = repo_parse_tree_indirect(r, head);
 	if (!trees[nr_trees++]) {
 		rollback_lock_file(&lock_file);
 		return -1;
 	}
-	trees[nr_trees] = parse_tree_indirect(remote);
+	trees[nr_trees] = repo_parse_tree_indirect(r, remote);
 	if (!trees[nr_trees++]) {
 		rollback_lock_file(&lock_file);
 		return -1;
diff --git a/reset.c b/reset.c
index e3383a93343..a0ac5e8a684 100644
--- a/reset.c
+++ b/reset.c
@@ -153,7 +153,7 @@  int reset_head(struct repository *r, const struct reset_head_opts *opts)
 		goto leave_reset_head;
 	}
 
-	tree = parse_tree_indirect(oid);
+	tree = repo_parse_tree_indirect(r, oid);
 	prime_cache_tree(r, r->index, tree);
 
 	if (write_locked_index(r->index, &lock, COMMIT_LOCK) < 0) {
diff --git a/revision.c b/revision.c
index 36e31942cee..dab5ddaf039 100644
--- a/revision.c
+++ b/revision.c
@@ -74,7 +74,7 @@  static void mark_tree_contents_uninteresting(struct repository *r,
 	struct tree_desc desc;
 	struct name_entry entry;
 
-	if (parse_tree_gently(tree, 1) < 0)
+	if (repo_parse_tree_gently(r, tree, 1) < 0)
 		return;
 
 	init_tree_desc(&desc, tree->buffer, tree->size);
@@ -181,7 +181,7 @@  static void add_children_by_path(struct repository *r,
 	if (!tree)
 		return;
 
-	if (parse_tree_gently(tree, 1) < 0)
+	if (repo_parse_tree_gently(r, tree, 1) < 0)
 		return;
 
 	init_tree_desc(&desc, tree->buffer, tree->size);
diff --git a/sequencer.c b/sequencer.c
index a4d85f1fbdd..a4c09dfa182 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -685,9 +685,9 @@  static int do_recursive_merge(struct repository *r,
 		o.buffer_output = 2;
 	o.show_rename_progress = 1;
 
-	head_tree = parse_tree_indirect(head);
-	next_tree = next ? get_commit_tree(next) : empty_tree(r);
-	base_tree = base ? get_commit_tree(base) : empty_tree(r);
+	head_tree = repo_parse_tree_indirect(r, head);
+	next_tree = next ? repo_get_commit_tree(r, next) : empty_tree(r);
+	base_tree = base ? repo_get_commit_tree(r, base) : empty_tree(r);
 
 	for (i = 0; i < opts->xopts_nr; i++)
 		parse_merge_opt(&o, opts->xopts[i]);