(path, mode)
| 73 | |
| 74 | |
| 75 | def file_bytes(path, mode): |
| 76 | metadata = path.lstat() |
| 77 | if mode == '120000': |
| 78 | if not stat.S_ISLNK(metadata.st_mode): |
| 79 | raise ValueError('not a symlink: ' + str(path)) |
| 80 | return os.fsencode(os.readlink(path)) |
| 81 | if not stat.S_ISREG(metadata.st_mode) or bool(metadata.st_mode & 0o111) != (mode == '100755'): |
| 82 | raise ValueError('wrong kind or mode: ' + str(path)) |
| 83 | return path.read_bytes() |
| 84 | |
| 85 | |
| 86 | def verify_checkout(repo, manifest): |