grep: stop computing information for --diff when unnecessary
This is one reason why `hg grep pattern` essentially does `hg cat -r
. 'set:**'` inside. There is no speed improvement in this commit,
because the rest of the code still greps data from filelog instead of
working copy when possible.
Differential Revision: https://phab.mercurial-scm.org/D8544