git/builtin
Jeff King 116761ba9c commit: avoid writing to global in option callback
The callback function for --trailer writes directly to the global
trailer_args and ignores opt->value completely. This is OK, since that's
where we expect to find the value. But it does mean the option
declaration isn't as clear. E.g., we have:

    OPT_BOOL(0, "reset-author", &renew_authorship, ...),
    OPT_CALLBACK_F(0, "trailer", NULL, ..., opt_pass_trailer)

In the first one we can see where the result will be stored, but in the
second, we get only NULL, and you have to go read the callback.

Let's pass &trailer_args, and use it in the callback. As a bonus, this
silences a -Wunused-parameter warning.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-06 09:58:06 -07:00
..
2022-06-07 14:10:56 -07:00
2020-07-30 19:18:06 -07:00
2022-04-06 09:42:14 -07:00
2022-08-05 15:52:14 -07:00
2022-02-17 16:25:05 -08:00
2021-10-28 09:57:09 -07:00
2022-09-14 12:56:39 -07:00
2022-09-02 10:02:56 -07:00
2022-09-14 12:56:39 -07:00
2021-04-14 13:47:21 -07:00
2022-09-19 14:35:23 -07:00
2022-09-14 12:56:39 -07:00
2022-09-14 12:56:39 -07:00
2022-08-08 13:23:26 -07:00
2022-09-14 12:56:39 -07:00
2021-11-03 13:25:36 -07:00
2020-08-11 18:04:11 -07:00