diff: factor out add_diff_options()
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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
e7e5c6f715
commit
c5630c4868
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user