Only create GitCommitResolver when doing symbol search
Created by: eseliger
Answer to https://github.com/sourcegraph/sourcegraph/pull/11558#issuecomment-647476049.
Previously, it would have been created independently of the search type.
Now, it still shares the commit resolver, but doesn't actually create the commit resolver when we don't need one.