}
grep_source_init(&gs, GREP_SOURCE_OID, pathbuf.buf, path, oid);
+ strbuf_release(&pathbuf);
#ifndef NO_PTHREADS
if (num_threads) {
* its fields, so do not call grep_source_clear()
*/
add_work(opt, &gs);
- strbuf_release(&pathbuf);
return 0;
} else
#endif
{
int hit;
- strbuf_release(&pathbuf);
hit = grep_source(opt, &gs);
grep_source_clear(&gs);
strbuf_addstr(&buf, filename);
grep_source_init(&gs, GREP_SOURCE_FILE, buf.buf, filename, filename);
+ strbuf_release(&buf);
#ifndef NO_PTHREADS
if (num_threads) {
* its fields, so do not call grep_source_clear()
*/
add_work(opt, &gs);
- strbuf_release(&buf);
return 0;
} else
#endif
{
int hit;
- strbuf_release(&buf);
hit = grep_source(opt, &gs);
grep_source_clear(&gs);
free(data);
return hit;
}
- die(_("unable to grep from object of type %s"), typename(obj->type));
+ die(_("unable to grep from object of type %s"), type_name(obj->type));
}
static int grep_objects(struct grep_opt *opt, const struct pathspec *pathspec,
OPT_BOOL('L', "files-without-match",
&opt.unmatch_name_only,
N_("show only the names of files without match")),
- OPT_BOOL('z', "null", &opt.null_following_name,
- N_("print NUL after filenames")),
+ OPT_BOOL_F('z', "null", &opt.null_following_name,
+ N_("print NUL after filenames"),
+ PARSE_OPT_NOCOMPLETE),
OPT_BOOL('c', "count", &opt.count,
N_("show the number of matches instead of matching lines")),
OPT__COLOR(&opt.color, N_("highlight matches")),
OPT_GROUP(""),
{ OPTION_STRING, 'O', "open-files-in-pager", &show_in_pager,
N_("pager"), N_("show matching files in the pager"),
- PARSE_OPT_OPTARG, NULL, (intptr_t)default_pager },
- OPT_BOOL(0, "ext-grep", &external_grep_allowed__ignored,
- N_("allow calling of grep(1) (ignored by this build)")),
+ PARSE_OPT_OPTARG | PARSE_OPT_NOCOMPLETE,
+ NULL, (intptr_t)default_pager },
+ OPT_BOOL_F(0, "ext-grep", &external_grep_allowed__ignored,
+ N_("allow calling of grep(1) (ignored by this build)"),
+ PARSE_OPT_NOCOMPLETE),
OPT_END()
};