Re: [GSoC][PATCH] grep: fix worktree case in submodules

2019-07-31 Thread Matheus Tavares Bernardino
On Wed, Jul 31, 2019 at 12:57 PM Junio C Hamano wrote: > > Christian Couder writes: > > > On Tue, Jul 30, 2019 at 10:04 PM Junio C Hamano wrote: > >> > >> Matheus Tavares writes: > > > >> > @@ -598,7 +599,8 @@ static int grep_tree(struct grep_opt *opt, const > >> > struct pathspec *pathspec, >

Re: [GSoC][PATCH] grep: fix worktree case in submodules

2019-07-31 Thread Junio C Hamano
Christian Couder writes: > On Tue, Jul 30, 2019 at 10:04 PM Junio C Hamano wrote: >> >> Matheus Tavares writes: > >> > @@ -598,7 +599,8 @@ static int grep_tree(struct grep_opt *opt, const >> > struct pathspec *pathspec, >> > free(data); >> > } else if (recur

Re: [GSoC][PATCH] grep: fix worktree case in submodules

2019-07-30 Thread Matheus Tavares Bernardino
On Tue, Jul 30, 2019 at 5:04 PM Junio C Hamano wrote: > > Matheus Tavares writes: > > > @@ -475,7 +475,7 @@ static int grep_submodule(struct grep_opt *opt, > > strbuf_release(&base); > > free(data); > > } else { > > - hit = grep_cache(&subopt, pathspe

Re: [GSoC][PATCH] grep: fix worktree case in submodules

2019-07-30 Thread Christian Couder
On Tue, Jul 30, 2019 at 10:04 PM Junio C Hamano wrote: > > Matheus Tavares writes: > > @@ -598,7 +599,8 @@ static int grep_tree(struct grep_opt *opt, const struct > > pathspec *pathspec, > > free(data); > > } else if (recurse_submodules && S_ISGITLINK(entry.m

Re: [GSoC][PATCH] grep: fix worktree case in submodules

2019-07-30 Thread Junio C Hamano
Matheus Tavares writes: > @@ -475,7 +475,7 @@ static int grep_submodule(struct grep_opt *opt, > strbuf_release(&base); > free(data); > } else { > - hit = grep_cache(&subopt, pathspec, 1); > + hit = grep_cache(&subopt, pathspec, cached); >

[GSoC][PATCH] grep: fix worktree case in submodules

2019-07-30 Thread Matheus Tavares
Running git-grep with --recurse-submodules results in a cached grep for the submodules even when --cached is not used. This makes all modifications in submodules' tracked files be always ignored when grepping. Solve that making git-grep respect the cached option when invoking grep_cache() inside gr