Junio C Hamano <gits...@pobox.com> writes:

> One technique these (not just this) recent efforts seem to be
> forgetting is to introduce "new" names that take a_repo and then
> make the existing one a thin wrapper that calls the new one with
> &the_repo as the argument.

FWIW, here is how I am resolving semantic conflicts that I found so
far while merging this topic to 'pu', which is stored in the
merge-fix/ mechanism so that I can reuse it while rebuilding 'pu'.

-- >8 --
Subject: [PATCH] merge-fix/sb/object-store-lookup

---
 builtin/bisect--helper.c | 2 +-
 builtin/branch-diff.c    | 2 +-
 commit-graph.c           | 4 ++--
 negotiator/default.c     | 3 ++-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index fc02f889e6..b27f645744 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -231,7 +231,7 @@ static int bisect_write(const char *state, const char *rev,
                goto fail;
        }
 
-       commit = lookup_commit_reference(&oid);
+       commit = lookup_commit_reference(the_repository, &oid);
        log_commit(fp, "%s", state, commit);
 
        if (!nolog)
diff --git a/builtin/branch-diff.c b/builtin/branch-diff.c
index 8a16352e3a..b8604e3fec 100644
--- a/builtin/branch-diff.c
+++ b/builtin/branch-diff.c
@@ -329,7 +329,7 @@ static void output_pair_header(struct diff_options 
*diffopt, struct strbuf *buf,
                strbuf_addf(buf, " %d:  %s", j + 1,
                            find_unique_abbrev(&b_util->oid, DEFAULT_ABBREV));
 
-       commit = lookup_commit_reference(oid);
+       commit = lookup_commit_reference(the_repository, oid);
        if (commit) {
                const char *commit_buffer = get_commit_buffer(commit, NULL);
                const char *subject;
diff --git a/commit-graph.c b/commit-graph.c
index e4dee03679..41a0133ff7 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -924,7 +924,7 @@ int verify_commit_graph(struct repository *r, struct 
commit_graph *g)
                        cur_fanout_pos++;
                }
 
-               graph_commit = lookup_commit(&cur_oid);
+               graph_commit = lookup_commit(r, &cur_oid);
                if (!parse_commit_in_graph_one(g, graph_commit))
                        graph_report("failed to parse %s from commit-graph",
                                     oid_to_hex(&cur_oid));
@@ -950,7 +950,7 @@ int verify_commit_graph(struct repository *r, struct 
commit_graph *g)
 
                hashcpy(cur_oid.hash, g->chunk_oid_lookup + g->hash_len * i);
 
-               graph_commit = lookup_commit(&cur_oid);
+               graph_commit = lookup_commit(r, &cur_oid);
                odb_commit = (struct commit *)create_object(r, cur_oid.hash, 
alloc_commit_node(r));
                if (parse_commit_internal(odb_commit, 0, 0)) {
                        graph_report("failed to parse %s from object database",
diff --git a/negotiator/default.c b/negotiator/default.c
index 382fc77722..d8c92281bb 100644
--- a/negotiator/default.c
+++ b/negotiator/default.c
@@ -38,7 +38,8 @@ static void rev_list_push(struct negotiation_state *ns,
 static int clear_marks(const char *refname, const struct object_id *oid,
                       int flag, void *cb_data)
 {
-       struct object *o = deref_tag(parse_object(oid), refname, 0);
+       struct object *o = deref_tag(the_repository,
+                                    parse_object(the_repository, oid), 
refname, 0);
 
        if (o && o->type == OBJ_COMMIT)
                clear_commit_marks((struct commit *)o,
-- 
2.18.0-129-ge3331758f1



Reply via email to