X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fgrep.c;h=dc6de83ab7c8178fc14d9e27679cb0b22f9caba3;hb=d31f3785dcc10459540e2e185b6e25363f719256;hp=9ce064ac1131e9a93383f568bb6f567791740b77;hpb=bff64a9cdabee8476ad1d2e45f586a2d6a884363;p=git.git diff --git a/builtin/grep.c b/builtin/grep.c index 9ce064ac1..dc6de83ab 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -325,11 +325,8 @@ static int grep_config(const char *var, const char *value, void *cb) struct grep_opt *opt = cb; char *color = NULL; - switch (userdiff_config(var, value)) { - case 0: break; - case -1: return -1; - default: return 0; - } + if (userdiff_config(var, value) < 0) + return -1; if (!strcmp(var, "grep.extendedregexp")) { if (git_config_bool(var, value)) @@ -1034,8 +1031,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); }