Homestyx hydra

R1:ec9eaabfbdac

Allow repo updates to recover after force push + garbage collection

Summary:
Fixes T5839. If a repository has been force pushed and garbage collected, we might have a ref cursor in the database which still points at the old commit (which no longer exists).

We'll then run a command like `git log <new hash> --not <old hash>` to figure out which commits are newly pushed, and this will bomb out because `<old hash>` is invalid.

Instead, validate all the `<old hash>` values before we try to make use of them.
Repository: R1 hydra
Commit Date: Aug 12 2014