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:
Chuck
2026-09-17 13:08:18 -04:00
co-authored by Claude Opus 5
parent 8cd08ccbc4
commit c39653a458
+5
View File
@@ -349,6 +349,11 @@ def _device_with_plugin_and_script(tmp_path):
('scripts/run.sh', 'echo hi\n')):
(repo.seed / rel).parent.mkdir(parents=True, exist_ok=True)
(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, 'update-index', '--chmod=+x', 'scripts/run.sh')
git(repo.seed, 'commit', '-qm', 'layout')