summaryrefslogtreecommitdiff
path: root/builtin/reset.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-07-25 21:39:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-08-02 21:35:08 (GMT)
commit5556808690ea245708fb80383be5c1afee2fb3eb (patch)
tree48b7ef9c30f3426a1e68b44346d425ec1914eaa1 /builtin/reset.c
parent9ef23f91fc22be9327288c8dbb10646bb0bf4340 (diff)
downloadgit-5556808690ea245708fb80383be5c1afee2fb3eb.zip
git-5556808690ea245708fb80383be5c1afee2fb3eb.tar.gz
git-5556808690ea245708fb80383be5c1afee2fb3eb.tar.bz2
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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/reset.c b/builtin/reset.c
index 046403e..772d078 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;