job4: seam session-start.sh
Env-var-only seam (§3.2), zero logic change (diff is one added condition): the version-check `git fetch` at :215 now skips when SESSION_START_OFFLINE is set (non-empty), leaving _remote_ver empty (same as any other offline/fetch-failure path already handled) instead of hitting the network. Unlocks (BACKLOG, not built here): a HOME-injected truth-table + smoke test for session-start.sh (J4-14), without every run paying a network round-trip or depending on origin/main being reachable. Verified: bash -n clean, shellcheck clean (pre-existing SC1091 info only, unrelated). Behavioral: SESSION_START_OFFLINE=1 runs in ~15ms (no fetch) vs ~740ms unset (fetch attempted) — identical banner output either way (v4.0.0 == CONFIG_VERSION, no update line in both). Full `make test` exit 0.
This commit is contained in:
@@ -211,7 +211,7 @@ if [ -n "$REPO_DIR" ] && [ -f "$REPO_DIR/CLAUDE.md" ]; then
|
|||||||
fi
|
fi
|
||||||
# Version check: compare local vs remote (non-blocking)
|
# Version check: compare local vs remote (non-blocking)
|
||||||
_remote_ver=""
|
_remote_ver=""
|
||||||
if [ -n "$REPO_DIR" ] && [ -d "$REPO_DIR/.git" ]; then
|
if [ -n "$REPO_DIR" ] && [ -d "$REPO_DIR/.git" ] && [ -z "${SESSION_START_OFFLINE:-}" ]; then
|
||||||
_remote_ver=$(cd "$REPO_DIR" 2>/dev/null && git fetch origin --quiet 2>/dev/null && git show origin/main:version.txt 2>/dev/null) || _remote_ver=""
|
_remote_ver=$(cd "$REPO_DIR" 2>/dev/null && git fetch origin --quiet 2>/dev/null && git show origin/main:version.txt 2>/dev/null) || _remote_ver=""
|
||||||
fi
|
fi
|
||||||
if [ -n "$_remote_ver" ] && [ "$_remote_ver" != "$CONFIG_VERSION" ]; then
|
if [ -n "$_remote_ver" ] && [ "$_remote_ver" != "$CONFIG_VERSION" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user