Re: [PATCH 02/13] commit-graph: stop depending on `struct odb_source`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 6, 2026, 12:18 UTC
- Message-ID
- <asTnDMrTjUWHVSwR@pks.im>
- In-Reply-To
- <CAOLa=ZSNHWFw5Vj_5qg16ipp1QA0pDcV8h=hOA=ma4hy6F_LcQ@mail.gmail.com>
On Mon, Oct 05, 2026 at 03:43:44PM -0400, Karthik Nayak wrote:
> Patrick Steinhardt <ps@pks.im> writes: > > [snip]
Thanks for trimming! One more ask though: it's helpful to retain the diff header itself so that one knows which file this is that you are commenting on :)
Show 22 quoted lines
> > @@ -28,7 +29,7 @@
> > #include "tree.h"
> > #include "chunk-format.h"
> >
> > -void git_test_write_commit_graph_or_die(struct odb_source *source)
> > +void git_test_write_commit_graph_or_die(struct repository *repo)
> > {
> > int flags = 0;
> > if (!git_env_bool(GIT_TEST_COMMIT_GRAPH, 0))
> > @@ -37,7 +38,7 @@ void git_test_write_commit_graph_or_die(struct odb_source *source)
> > if (git_env_bool(GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS, 0))
> > flags = COMMIT_GRAPH_WRITE_BLOOM_FILTERS;
> >
> > - if (write_commit_graph_reachable(source, flags, NULL))
> > + if (write_commit_graph_reachable(repo, repo->objects->sources->path, flags, NULL))
> > die("failed to write commit-graph under GIT_TEST_COMMIT_GRAPH");
> > }
> >
>
> Shouldn't the caller of `git_test_write_commit_graph_or_die()` send in
> (repo, path) and we forward that path, instead of using the path from
> `repo->objects->sources->path`?I'd agree if this were a properly designed function. But it's basically just a hack for our test suite, so I was aiming for the easiest fix possible to make this work.
Patrick