Only grab the gerrit change if necessary

Complete an old todo by checking if it is necessary to grab a change
either if the project is managed or if it's in the cache (for example
from a depends-on).

Change-Id: I6bc4cf05fcc839413ef9a9a6c75924ae93328559
1 file changed