setup: split off code to handle stumbling upon a repository