Bug 1021355

Check for git objects with `git rev-parse` rather than for references with
`git show-ref`.