git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Fix the result of "git grep [-l|-L] -C <num>"
@ 2012-01-23 17:06 Albert Yale
  0 siblings, 0 replies; only message in thread
From: Albert Yale @ 2012-01-23 17:06 UTC (permalink / raw)
  To: git; +Cc: trast, rene.scharfe, Albert Yale

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

Reviewed-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Albert Yale <surfingalbert@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-23 17:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-23 17:06 [PATCH v2] Fix the result of "git grep [-l|-L] -C <num>" Albert Yale

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).