Re: [PATCH 12/21] patch-ids.c: remove implicit dependency on the_index

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

 



> -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)



[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