aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/gitclient.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <[email protected]>2021-12-10 13:02:13 +0200
committerOrgad Shaneh <[email protected]>2021-12-12 13:55:33 +0000
commit32d3fa755e3110618d9d16719a406cf7155c7cdb (patch)
treef235921166cc151239b07139fff4d8a66c7aa0a2 /src/plugins/git/gitclient.cpp
parenta3af941adf90bde0a2700f250f8d102cbdea3267 (diff)
Git: Support filtering log entries by author
+ quote arguments with potential spaces. Change-Id: Ifd1bfecd7c30d145592432dff76c72024d2b1426 Reviewed-by: AndrĂ© Hartmann <[email protected]>
Diffstat (limited to 'src/plugins/git/gitclient.cpp')
-rw-r--r--src/plugins/git/gitclient.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index c644b4522b0..c99ef9a348b 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -44,6 +44,7 @@
#include <utils/algorithm.h>
#include <utils/checkablemessagebox.h>
+#include <utils/commandline.h>
#include <utils/fileutils.h>
#include <utils/hostosinfo.h>
#include <utils/mimetypes/mimedatabase.h>
@@ -1137,15 +1138,19 @@ void GitClient::log(const FilePath &workingDirectory, const QString &fileName,
if (!arguments.contains(graphOption) && !arguments.contains(patchOption))
arguments << normalLogArguments();
+ const QString authorValue = editor->authorValue();
+ if (!authorValue.isEmpty())
+ arguments << "--author=" + ProcessArgs::quoteArg(authorValue);
+
const QString grepValue = editor->grepValue();
if (!grepValue.isEmpty())
- arguments << "--grep=" + grepValue;
+ arguments << "--grep=" + ProcessArgs::quoteArg(grepValue);
const QString pickaxeValue = editor->pickaxeValue();
if (!pickaxeValue.isEmpty())
- arguments << "-S" << pickaxeValue;
+ arguments << "-S" << ProcessArgs::quoteArg(pickaxeValue);
- if ((!grepValue.isEmpty() || !pickaxeValue.isEmpty()) && !editor->caseSensitive())
+ if (!editor->caseSensitive())
arguments << "-i";
if (!fileName.isEmpty())