diff --git a/tests/25_try_demo.bats b/tests/25_try_demo.bats index 2977444..f641e4e 100644 --- a/tests/25_try_demo.bats +++ b/tests/25_try_demo.bats @@ -54,8 +54,18 @@ done cp "$FAKE_INSTALL" "$out" EOF - # Fake orbit runtime: clone/new/done all no-op. - printf '#!/usr/bin/env bash\nexit 0\n' > "$MOCK_BIN/orbit" + # Fake orbit runtime: new/done are no-ops; clone materializes a real repo, + # because try.sh writes a repo-local demo identity into each pool clone's + # config (zero-config git support) right after cloning. + cat > "$MOCK_BIN/orbit" <<'EOF' +#!/usr/bin/env bash +if [ "$1" = "clone" ]; then + name="$(basename "${2%.git}")" + mkdir -p "$ORBIT_TRY_DIR/.repos" + git init -q "$ORBIT_TRY_DIR/.repos/$name" +fi +exit 0 +EOF chmod +x "$MOCK_BIN/curl" "$MOCK_BIN/orbit" "$FAKE_INSTALL" } diff --git a/try.sh b/try.sh index 31eddf7..7c24b63 100755 --- a/try.sh +++ b/try.sh @@ -354,7 +354,7 @@ build_bare() { git init -q "$work" git -C "$work" -c core.hooksPath=/dev/null add . git -C "$work" -c core.hooksPath=/dev/null \ - -c user.email=pilot@orbit.dev -c user.name=Pilot commit -qm "$msg" + -c user.email=pilot@localhost -c user.name=Pilot commit -qm "$msg" git clone -q --bare "$work" "$UPSTREAM/$name.git" rm -rf "$work" } @@ -372,6 +372,16 @@ say "⚙ Adding both repos to the Orbit pool ..." orbit clone "$UPSTREAM/navigator.git" >/dev/null orbit clone "$UPSTREAM/mission-control.git" >/dev/null +# Repo-local identity for the demo pool clones: the agent commits from inside +# the workspace worktrees, and worktrees read the repo's common config — so a +# zero-config git (fresh VM/container: no global user.name/user.email) would +# otherwise fail every demo commit with "Author identity unknown" (exit 128). +# Everything lives under $TRY_DIR, so this never touches the user's real repos. +for r in "$TRY_DIR/.repos/navigator" "$TRY_DIR/.repos/mission-control"; do + git -C "$r" config user.name "Pilot" + git -C "$r" config user.email "pilot@localhost" +done + GOAL="Downlink a fuel-reserve field in the telemetry frame so mission-control can watch the tank burn — keep the encoder (navigator) and decoder (mission-control) in lockstep" say "⚙ Creating a workspace for the mission ..." orbit new "$GOAL" --name mission >/dev/null