DORMANTno replies REVIEWED: 1 (0M)

1 review trailer.

[PATCH v2] Fix the result of "git grep [-l|-L] -C <num>"

From: Albert Yale <hidden>
Date: 2016-06-15 22:52:51
Subsystem: the rest · Maintainer: Linus Torvalds

When combining "git grep [-l|-L]" with "-C <num>",
the first result is omitted.

Reviewed-by: Thomas Rast <redacted>
Signed-off-by: Albert Yale <redacted>
---
 builtin/grep.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/builtin/grep.c b/builtin/grep.c
index 9ce064a..beebe20 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -1036,7 +1036,10 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 	if (use_threads) {
 		if (opt.pre_context || opt.post_context || opt.file_break ||
 		    opt.funcbody)
-			skip_first_line = 1;
+		{
+			if( ! ( opt.name_only || opt.unmatch_name_only ) )
+				skip_first_line = 1;
+		}
 		start_threads(&opt);
 	}
 #endif
-- 
1.7.8.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help