fix(packaging): preserve device-test source bytes in subtree archives

This commit is contained in:
chenmingxuan committed 2026-10-30 12:45:26 +08:00
1 parent 7d31e09cb7
commit 3a69c20742
1 file changed
+10 -1
+10 -1
View File
@@ -31,7 +31,16 @@ def main():
root = Path(__file__).resolve().parents[1]
commit = git(root, "rev-parse", "--verify", "--end-of-options", args.ref + "^{commit}")
commit = commit.decode("ascii").strip()
source = git(root, "archive", "--format=tar", commit + ":plugins/artemis-device-test")
# A subtree archive does not retain its parent's attributes; disable checkout
# conversion explicitly so source-manifest hashes still bind the Git blobs.
source = git(
root,
"-c",
"core.autocrlf=false",
"archive",
"--format=tar",
commit + ":plugins/artemis-device-test",
)
files = {}
with tarfile.open(fileobj=io.BytesIO(source)) as tree:
for entry in tree: