mirror of
https://github.com/git/git.git
synced 2026-03-06 07:19:08 +01:00
add-patch: split out struct interactive_options
The `struct add_p_opt` is reused both by our infra for "git add -p" and "git add -i". Users of `run_add_i()` for example are expected to pass `struct add_p_opt`. This is somewhat confusing and raises the question of which options apply to what part of the stack. But things are even more confusing than that: while callers are expected to pass in `struct add_p_opt`, these options ultimately get used to initialize a `struct add_i_state` that is used by both subsystems. So we are basically going full circle here. Refactor the code and split out a new `struct interactive_options` that hosts common options used by both. These options are then applied to a `struct interactive_config` that hosts common configuration. This refactoring doesn't yet fully detangle the two subsystems from one another, as we still end up calling `init_add_i_state()` in the "git add -p" subsystem. This will be fixed in a subsequent commit. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
6e4d923267
commit
e3d4d7787c
2
commit.h
2
commit.h
@@ -287,7 +287,7 @@ int for_each_commit_graft(each_commit_graft_fn, void *);
|
||||
int interactive_add(struct repository *repo,
|
||||
const char **argv,
|
||||
const char *prefix,
|
||||
int patch, struct add_p_opt *add_p_opt);
|
||||
int patch, struct interactive_options *opts);
|
||||
|
||||
struct commit_extra_header {
|
||||
struct commit_extra_header *next;
|
||||
|
||||
Reference in New Issue
Block a user