summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8104ebf)
raw | patch | inline | side by side (parent: 8104ebf)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Sat, 27 Dec 2008 08:21:04 +0000 (15:21 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 27 Dec 2008 22:30:41 +0000 (14:30 -0800) |
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-grep.c | patch | blob | history |
diff --git a/builtin-grep.c b/builtin-grep.c
index 624f86e287cf6304d122850f8258444c5f916702..3c97c2c4d5e067706fb0987ac2390482107bc789 100644 (file)
--- a/builtin-grep.c
+++ b/builtin-grep.c
#endif
#endif
+static int builtin_grep;
+
/*
* git grep pathspecs are somewhat different from diff-tree pathspecs;
* pathname wildcards are allowed.
* we grep through the checked-out files. It tends to
* be a lot more optimized
*/
- if (!cached) {
+ if (!cached && !builtin_grep) {
hit = external_grep(opt, paths, cached);
if (hit >= 0)
return hit;
cached = 1;
continue;
}
+ if (!strcmp("--no-ext-grep", arg)) {
+ builtin_grep = 1;
+ continue;
+ }
if (!strcmp("-a", arg) ||
!strcmp("--text", arg)) {
opt.binary = GREP_BINARY_TEXT;