From 6ea3740d5f26adda0ce458da212b176f92aafa11 Mon Sep 17 00:00:00 2001 From: Andrey Epifancev Date: Sat, 24 Oct 2026 19:03:17 +0400 Subject: [PATCH] =?UTF-8?q?fix(dsh):=20run.sh=20=D1=87=D0=B8=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=20dsh/bundle/hooks=20=D0=B2=20worktree=20(#56)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit При core.symlinks=false новый worktree получает dsh/bundle/hooks обычным файлом с текстом ../../hooks, и пять guard-тестов падают на BLOCKED. run.sh перед прогоном восстанавливает симлинк (печатает строку о починке), каталог-копию принимает как есть, незнакомое содержимое — явный FAIL. Co-Authored-By: DeepSeek Harness --- dsh/tests/run.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dsh/tests/run.sh b/dsh/tests/run.sh index 9254d17..c6ac70b 100755 --- a/dsh/tests/run.sh +++ b/dsh/tests/run.sh @@ -4,6 +4,25 @@ set -euo pipefail root="$(cd "$(dirname "$0")/../.." && pwd)" cd "$root" +# `core.symlinks=false` checkouts materialize the tracked `dsh/bundle/hooks` +# symlink as a regular file containing "../../hooks". Repair it before the +# tests, otherwise five guard tests fail with BLOCKED instead of testing. +ensure_bundle_hooks() { + local link="$root/dsh/bundle/hooks" + [ -L "$link" ] && return 0 # symlink (or a repaired one) + [ -d "$link" ] && return 0 # published bundle: a real copy of hooks/ + if [ -f "$link" ] && [ "$(cat "$link")" = "../../hooks" ]; then + rm -f "$link" + ln -s ../../hooks "$link" + echo "repaired dsh/bundle/hooks -> ../../hooks (core.symlinks=false checkout)" + return 0 + fi + echo "FAIL: dsh/bundle/hooks is neither a symlink to ../../hooks nor a copy of hooks/" >&2 + exit 2 +} + +ensure_bundle_hooks + for f in dsh/bundle/index.js dsh/bundle/command-role.js dsh/bundle/lib/*.js dsh/tests/*.mjs; do node --check "$f" done -- 2.47.2