Lee-W commented on code in PR #71477:
URL: https://github.com/apache/airflow/pull/71477#discussion_r4130160473
##########
dev/registry/extract_versions.py:
##########
@@ -129,6 +130,70 @@ def git_show(tag: str, path: str) -> str | None:
return None
+def git_ls_tree(tag: str, prefix: str) -> list[str]:
+ """List the file paths under a prefix at a specific git tag.
+
+ Decodes via the process locale (`text=True`), unlike `git_cat_file_batch`'s
+ UTF-8 decode -- and `git_cat_file_batch` re-encodes these same strings
+ (passed straight through by `read_guide_docs`) into its stdin, so a
+ non-UTF-8 locale could break byte-for-byte round-trip. No such path exists
+ under `providers/` today.
+ """
+ try:
+ result = subprocess.run(
+ ["git", "-c", "core.quotePath=false", "ls-tree", "-r",
"--name-only", tag, "--", prefix],
+ capture_output=True,
+ text=True,
Review Comment:
`git_ls_tree` decodes `result.stdout` as UTF-8 and the docstring is down to
its summary line.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]