repository: ensure git_repository_discover() returns ENOTFOUND when unable to find a repository given the constraints