summaryrefslogtreecommitdiffstats
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2017-06-01 02:30:48 +0200
committerJunio C Hamano <gitster@pobox.com>2017-06-01 03:36:36 +0200
commit9071c078af637573a3068c6920dd4ceff6a5a69f (patch)
tree71590a61a533ec630a6af98f411725d5cfdb1116 /builtin/grep.c
parentIntroduce 'submodule.recurse' option for worktree manipulators (diff)
downloadgit-9071c078af637573a3068c6920dd4ceff6a5a69f.tar.xz
git-9071c078af637573a3068c6920dd4ceff6a5a69f.zip
builtin/grep.c: respect 'submodule.recurse' option
In builtin/grep.c we parse the config before evaluating the command line options. This makes the task of teaching grep to respect the new config option 'submodule.recurse' very easy by just parsing that option. As an alternative I had implemented a similar structure to treat submodules as the fetch/push command have, including * aligning the meaning of the 'recurse_submodules' to possible submodule values RECURSE_SUBMODULES_* as defined in submodule.h. * having a callback to parse the value and * reacting to the RECURSE_SUBMODULES_DEFAULT state that was the initial state. However all this is not needed for a true boolean value, so let's keep it simple. However this adds another place where "submodule.recurse" is parsed. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index b1095362fb..454e263820 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -302,6 +302,9 @@ static int grep_cmd_config(const char *var, const char *value, void *cb)
#endif
}
+ if (!strcmp(var, "submodule.recurse"))
+ recurse_submodules = git_config_bool(var, value);
+
return st;
}