Code

Merge branch 'maint-1.7.8' into maint-1.7.9
[git.git] / builtin / grep.c
index e741aca18cc1c9c3e5cfef3db996d05956bedc2d..9fc3e95cc610c9df7d2b17eae59ac2c161443982 100644 (file)
@@ -923,8 +923,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 
 #ifndef NO_PTHREADS
        if (use_threads) {
-               if (opt.pre_context || opt.post_context || opt.file_break ||
-                   opt.funcbody)
+               if (!(opt.name_only || opt.unmatch_name_only || opt.count)
+                   && (opt.pre_context || opt.post_context ||
+                       opt.file_break || opt.funcbody))
                        skip_first_line = 1;
                start_threads(&opt);
        }