From c5630c4868c74aab2fc4e8a4ef4bfc9c51534e0e Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Thu, 1 Dec 2022 23:49:11 +0100 Subject: diff: factor out add_diff_options() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a function for appending the parseopts member of struct diff_options to a struct option array. Use it in two sites instead of accessing the parseopts member directly. Decoupling callers from diff internals like that allows us to change the latter. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- builtin/range-diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin/range-diff.c') diff --git a/builtin/range-diff.c b/builtin/range-diff.c index e2a74efb42..aecfae12d3 100644 --- a/builtin/range-diff.c +++ b/builtin/range-diff.c @@ -47,7 +47,7 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix) repo_diff_setup(the_repository, &diffopt); - options = parse_options_concat(range_diff_options, diffopt.parseopts); + options = add_diff_options(range_diff_options, &diffopt); argc = parse_options(argc, argv, prefix, options, builtin_range_diff_usage, PARSE_OPT_KEEP_DASHDASH); -- cgit 1.2.3-korg