Merge branch 'tb/log-G-binary'
"git log -G<regex>" looked for a hunk in the "git log -p" patch output that contained a string that matches the given pattern. Optimize this code to ignore binary files, which by default will not show any hunk that would match any pattern (unless textconv or the --text option is in effect, that is). * tb/log-G-binary: log -G: ignore binary files
This commit is contained in:
@ -154,6 +154,12 @@ static int pickaxe_match(struct diff_filepair *p, struct diff_options *o,
|
||||
if (textconv_one == textconv_two && diff_unmodified_pair(p))
|
||||
return 0;
|
||||
|
||||
if ((o->pickaxe_opts & DIFF_PICKAXE_KIND_G) &&
|
||||
!o->flags.text &&
|
||||
((!textconv_one && diff_filespec_is_binary(o->repo, p->one)) ||
|
||||
(!textconv_two && diff_filespec_is_binary(o->repo, p->two))))
|
||||
return 0;
|
||||
|
||||
mf1.size = fill_textconv(o->repo, textconv_one, p->one, &mf1.ptr);
|
||||
mf2.size = fill_textconv(o->repo, textconv_two, p->two, &mf2.ptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user