From 948fad02d11ba422e180f4f15faf068eb4e69b9d Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 23 Jul 2017 08:01:41 +0300 Subject: [PATCH] Git: Recurse into submodules on grep if applicable (Git >= 2.13) Change-Id: I5028d6a46749b22cc0e0f5707c9e283126511902 Reviewed-by: Tobias Hunger --- src/plugins/git/gitgrep.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index 9e09c7a90a..59b1fb9566 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -144,7 +144,8 @@ public: GitClient *client = GitPlugin::client(); QStringList arguments = { "-c", "color.grep.match=bold red", - "grep", "-zn", "--no-full-name", "--color=always" + "-c", "color.grep=always", + "grep", "-zn", "--no-full-name" }; if (!(m_parameters.flags & FindCaseSensitively)) arguments << "-i"; @@ -154,6 +155,8 @@ public: arguments << "-P"; else arguments << "-F"; + if (client->gitVersion() >= 0x021300) + arguments << "--recurse-submodules"; arguments << "-e" << m_parameters.text; GitGrepParameters params = m_parameters.searchEngineParameters.value(); if (!params.ref.isEmpty()) { -- GitLab