()
| 49 | |
| 50 | |
| 51 | def committed_files() -> dict[str, Committed]: |
| 52 | tree = subprocess.run(["git", "ls-tree", "-rz", "HEAD"], check=True, capture_output=True, text=True).stdout |
| 53 | files: dict[str, Committed] = {} |
| 54 | for entry in tree.split("\0"): |
| 55 | # not a link (120000) or a submodule (160000) |
| 56 | if match := re.fullmatch(r"(100\d+) blob (\w+)\t(.*)", entry, re.DOTALL): |
| 57 | files[match[3]] = Committed(match[2], executable=match[1] == "100755") |
| 58 | return files |
| 59 | |
| 60 | |
| 61 | def version_bounds(text: str) -> str: |