Re: [PATCH 2/6] log-tree: drop unused commit param in remerge_diff()
- From
Elijah Newren <newren@gmail.com>
- Date
- Aug 19, 2022, 23:05 UTC
- Message-ID
- <CABPp-BHvscxV+vVL-Tew2H4h8V_3bZpD0Qz9uEMwrV=X3zrYSg@mail.gmail.com>
- In-Reply-To
- <Yv9O2RK7ahmw5ge7@coredump.intra.peff.net>
On Fri, Aug 19, 2022 at 1:50 AM Jeff King <peff@peff.net> wrote:
Show 41 quoted lines
>
> This function has never used its "commit" parameter since it was added
> in db757e8b8d (show, log: provide a --remerge-diff capability,
> 2022-02-02).
>
> This makes sense; we already have separate parameters for the parents
> (which lets us redo the merge) and the oid of the result tree (which we
> can then diff against the remerge result).
>
> Let's drop the unused parameter in the name of clarity.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> log-tree.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/log-tree.c b/log-tree.c
> index d0ac0a6327..82d9b5f650 100644
> --- a/log-tree.c
> +++ b/log-tree.c
> @@ -956,8 +956,7 @@ static void cleanup_additional_headers(struct diff_options *o)
>
> static int do_remerge_diff(struct rev_info *opt,
> struct commit_list *parents,
> - struct object_id *oid,
> - struct commit *commit)
> + struct object_id *oid)
> {
> struct merge_options o;
> struct commit_list *bases;
> @@ -1052,7 +1051,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log
> "for octopus merges.\n");
> return 1;
> }
> - return do_remerge_diff(opt, parents, oid, commit);
> + return do_remerge_diff(opt, parents, oid);
> }
> if (opt->combine_merges)
> return do_diff_combined(opt, commit);
> --
> 2.37.2.928.g0821088f4aYeah, looks like I could have just used commit instead of parents and oid, but since the calling code had those handy, I added them directly and forgot to remove commit.
Patch looks good.