Files
Agent-Intent/scripts/submodule-consistency.sh
T
weichen b450b03638 Initialize the repository with pinned submodules, project entry documents, and the design record
Details (original message):
Initialize the repository with pinned submodules, project entry documents, and the design record.
2026-09-29 15:20:38 +00:00

23 lines
673 B
Bash
Executable File

#!/bin/sh
# 核对本仓 gitlink 与已检出子模块 HEAD 是否一致。
# 嵌套副本是否与消费方自己的 deps 相同,由消费方仓库的同名脚本比较。
set -eu
cd "$(dirname "$0")/.."
fail=0
for path in deps/development-guidelines deps/error-code-system deps/logging-system; do
if [ ! -e "$path/.git" ]; then
echo "missing submodule checkout: $path" >&2
fail=1
continue
fi
recorded=$(git rev-parse ":$path")
actual=$(git -C "$path" rev-parse HEAD)
if [ "$recorded" != "$actual" ]; then
echo "gitlink mismatch: $path recorded=$recorded HEAD=$actual" >&2
fail=1
else
echo "ok $path $recorded"
fi
done
exit "$fail"