sha1_file: allow open_sha1_file to handle arbitrary repositories