Re: [PATCH 5/5] commit-graph: add repo arg to graph readers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> diff --git a/commit.c b/commit.c
> index 0030e79940..38c12b002f 100644
> --- a/commit.c
> +++ b/commit.c
> @@ -317,7 +317,7 @@ struct tree *get_commit_tree(const struct commit *commit)
>         if (commit->graph_pos == COMMIT_NOT_FROM_GRAPH)
>                 BUG("commit has NULL tree, but was not loaded from commit-graph");
>
> -       return get_commit_tree_in_graph(commit);
> +       return get_commit_tree_in_graph(the_repository, commit);

Here..

>  }
>
>  struct object_id *get_commit_tree_oid(const struct commit *commit)
> @@ -413,7 +413,7 @@ int parse_commit_gently(struct commit *item, int quiet_on_missing)
>                 return -1;
>         if (item->object.parsed)
>                 return 0;
> -       if (parse_commit_in_graph(item))
> +       if (parse_commit_in_graph(the_repository, item))

and here

> +static void test_parse_commit_in_graph(const char *gitdir, const char *worktree,
> +                                      const struct object_id *commit_oid)
> +{
> +       struct repository r;
> +       struct commit *c;
> +       struct commit_list *parent;
> +
> +       /*
> +        * Create a commit independent of any repository.
> +        */
> +       c = lookup_commit(commit_oid);

.. and this one are unfortunate as the rest of the object store series
has not progressed as far as needed.

The lookup_commit series is out there already, and that will
teach lookup_commit a repository argument. When rerolling
that series I need to switch the order of repo_init and lookup_commit
such that we can pass the repo to the lookup.

> +test_expect_success 'setup non-the_repository tests' '

> +test_expect_success 'parse_commit_in_graph works for non-the_repository' '

> +test_expect_success 'get_commit_tree_in_graph works for non-the_repository' '

This is really nice!

Overall this series looks good to me,
Stefan



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux