summaryrefslogtreecommitdiff
path: root/builtin/reset.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2017-06-01 00:30:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-01 01:36:36 (GMT)
commit046b48239eca34425909330e59da57f5fd421bdc (patch)
tree0b9e24fe8237837f2a3934ea36d9376df4616d10 /builtin/reset.c
parent1d789d089280539ca39b83aabb67860929d39b75 (diff)
downloadgit-046b48239eca34425909330e59da57f5fd421bdc.zip
git-046b48239eca34425909330e59da57f5fd421bdc.tar.gz
git-046b48239eca34425909330e59da57f5fd421bdc.tar.bz2
Introduce 'submodule.recurse' option for worktree manipulators
Any command that understands '--recurse-submodules' can have its default changed to true, by setting the new 'submodule.recurse' option. This patch includes read-tree/checkout/reset for working tree manipulating commands. Later patches will cover other commands. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/reset.c')
-rw-r--r--builtin/reset.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/reset.c b/builtin/reset.c
index 6f89dc5..585cfe0 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -266,6 +266,14 @@ static int reset_refs(const char *rev, const struct object_id *oid)
return update_ref_status;
}
+static int git_reset_config(const char *var, const char *value, void *cb)
+{
+ if (!strcmp(var, "submodule.recurse"))
+ return git_default_submodule_config(var, value, cb);
+
+ return git_default_config(var, value, cb);
+}
+
int cmd_reset(int argc, const char **argv, const char *prefix)
{
int reset_type = NONE, update_ref_status = 0, quiet = 0;
@@ -294,7 +302,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
OPT_END()
};
- git_config(git_default_config, NULL);
+ git_config(git_reset_config, NULL);
argc = parse_options(argc, argv, prefix, options, git_reset_usage,
PARSE_OPT_KEEP_DASHDASH);