repo-updater: extract shouldKeep function, add test
Created by: ijt
This follows up on https://github.com/sourcegraph/sourcegraph/pull/3643, which was in response to some panics happening in the repo-updater on sourcegraph.com.
Test plan: unit test