sha1_file: add repository argument to open_sha1_file