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
@@ -255,8 +255,7 @@ int diff_no_index(struct rev_info *revs,
|
||||
};
|
||||
struct option *options;
|
||||
|
||||
options = parse_options_concat(no_index_options,
|
||||
revs->diffopt.parseopts);
|
||||
options = add_diff_options(no_index_options, &revs->diffopt);
|
||||
argc = parse_options(argc, argv, revs->prefix, options,
|
||||
diff_no_index_usage, 0);
|
||||
if (argc != 2) {
|
||||
|
||||
Reference in New Issue
Block a user