Don't assume that every repository has a remote that we can pull

Fixes #1378