mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-13 10:36:35 +00:00
test(auto-update): make the seed script executable on disk, not only in the index
On Linux Repo.publish() commits with -a, which recorded scripts/run.sh as 100644 upstream because the seed file was never chmod +x. The pull then brought in the same mode the installer chmod had made locally, so installer_chmod saw no mode change left to check. The updater was fine: with the upstream commit at 100755 the --autostash carries the device's chmod across. Verified under Linux (WSL, git 2.43): the old helper fails exactly as CI did, the fixed one passes all 63 tests in the file. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -349,6 +349,11 @@ def _device_with_plugin_and_script(tmp_path):
|
|||||||
('scripts/run.sh', 'echo hi\n')):
|
('scripts/run.sh', 'echo hi\n')):
|
||||||
(repo.seed / rel).parent.mkdir(parents=True, exist_ok=True)
|
(repo.seed / rel).parent.mkdir(parents=True, exist_ok=True)
|
||||||
(repo.seed / rel).write_text(text)
|
(repo.seed / rel).write_text(text)
|
||||||
|
# Executable on disk too, not only in the index: Repo.publish() commits
|
||||||
|
# with -a, which on Linux would otherwise record run.sh as 100644 upstream
|
||||||
|
# and hide the device's own mode change behind the pull.
|
||||||
|
import os
|
||||||
|
os.chmod(repo.seed / 'scripts' / 'run.sh', 0o755)
|
||||||
git(repo.seed, 'add', '.')
|
git(repo.seed, 'add', '.')
|
||||||
git(repo.seed, 'update-index', '--chmod=+x', 'scripts/run.sh')
|
git(repo.seed, 'update-index', '--chmod=+x', 'scripts/run.sh')
|
||||||
git(repo.seed, 'commit', '-qm', 'layout')
|
git(repo.seed, 'commit', '-qm', 'layout')
|
||||||
|
|||||||
Reference in New Issue
Block a user