git-grep misses an instance of a string (after conflict)

From: Johannes Sixt <hidden>
Date: 2016-08-11 20:45:48

I've roughly had the following sequence of operations on a particular file
in my project:

1. git-cherry-pick a commit, which resulted in a conflict in in that file
2. edit the file to insert a particular string (which wasn't there before)
3. then:

$ git-grep getSibling -- kdbg/exprwnd.h    # this file had a conflict
$ grep getSibling -- kdbg/exprwnd.h       
    { return static_cast<VarTree*>(getSibling()); }
$ git-update-index kdbg/exprwnd.h
$ git-grep getSibling -- kdbg/exprwnd.h       
kdbg/exprwnd.h:    { return static_cast<VarTree*>(getSibling()); }

As you can see, the first git-grep doesn't find the string, but after the
update-index, it does find it.

This is unexpected behavior, in particular since the manual page talks about
git-grep to search the working tree. I understand that the conflict may
have influenced the behavior, but the manual page is not in line with the
behavior. Am I missing something?

-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help