fix(packaging): preserve device-test source bytes in subtree archives
This commit is contained in:
1 parent
7d31e09cb7
commit
3a69c20742
1 file changed
+10
-1
@@ -31,7 +31,16 @@ def main():
|
|||||||
root = Path(__file__).resolve().parents[1]
|
root = Path(__file__).resolve().parents[1]
|
||||||
commit = git(root, "rev-parse", "--verify", "--end-of-options", args.ref + "^{commit}")
|
commit = git(root, "rev-parse", "--verify", "--end-of-options", args.ref + "^{commit}")
|
||||||
commit = commit.decode("ascii").strip()
|
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 = {}
|
files = {}
|
||||||
with tarfile.open(fileobj=io.BytesIO(source)) as tree:
|
with tarfile.open(fileobj=io.BytesIO(source)) as tree:
|
||||||
for entry in tree:
|
for entry in tree:
|
||||||
|
|||||||
Reference in new issue
Block a user