> -int init_patch_ids(struct patch_ids *ids)
> +int init_patch_ids(struct patch_ids *ids, struct repository *repo)
>  {
>         memset(ids, 0, sizeof(*ids));
> -       diff_setup(&ids->diffopts, the_repository);
> +       diff_setup(&ids->diffopts, repo);

Just realized when looking at this diff, though it applies to
other patches as well. (and reading Documentation/technical/api-diff.txt
confirms my thinking IMHO)

What makes the repository argument any special compared
to the rest of the diff options?

So I would expect the setup to look like

    memset(ids, 0, sizeof(*ids));
    ids->diffopts->repo = the_repository;
    diff_setup(&ids->diffopts);

here and in diff_setup, we'd have

  if (!options->repo)
    options->repo = the_repository;

or even put the_repository into default_diff_options,
but then I wonder how this deals with no-repo invocations
(git diff --no-index examples for bug reports)

Reply via email to