diff options
author | Brandon Williams <bmwill@google.com> | 2017-07-26 00:39:16 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-03 00:35:08 +0300 |
commit | 5556808690ea245708fb80383be5c1afee2fb3eb (patch) | |
tree | 48b7ef9c30f3426a1e68b44346d425ec1914eaa1 /builtin/reset.c | |
parent | 9ef23f91fc22be9327288c8dbb10646bb0bf4340 (diff) |
add, reset: ensure submodules can be added or reset
Commit aee9c7d65 (Submodules: Add the new "ignore" config option for
diff and status) introduced the ignore configuration option for
submodules so that configured submodules could be omitted from the
status and diff commands. Because this flag is respected in the diff
machinery it has the unintended consequence of potentially prohibiting
users from adding or resetting a submodule, even when a path to the
submodule is explicitly given.
Ensure that submodules can be added or set, even if they are configured
to be ignored, by setting the `DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG` diff
flag.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/reset.c')
-rw-r--r-- | builtin/reset.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/reset.c b/builtin/reset.c index 046403ed68..772d078b85 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -156,6 +156,7 @@ static int read_from_tree(const struct pathspec *pathspec, opt.output_format = DIFF_FORMAT_CALLBACK; opt.format_callback = update_index_from_diff; opt.format_callback_data = &intent_to_add; + opt.flags |= DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG; if (do_diff_cache(tree_oid, &opt)) return 1; |