git: avoid hitting disk to render search results.

Previously, we were hitting disk once to get the name of the project
directory and branch shortname.

This caches both when loading the repository.