Avoid validating valid commits two times in ReceiveCommits.

There was at least one case where valid commits were validated two
times. For example, when a new patch set for an existing change was
pushed, the first validation for that commit was done (early) from
the selectNewChanges method and the second validation of the same commit
was done from the inner ReplaceRequest class. The first (early)
validation was obviously done for performance reasons to fail fast for
invalid commits. However, as a side effect, valid commits were validated
two times.

Cache already validated valid commits and don't validate them again
for the same ReceiveCommits command.

Change-Id: I221284a27ee475f84c1726b4d50553b755d2b4fe
1 file changed