diff --git a/setup.sh b/setup.sh index d010b44..881ff17 100755 --- a/setup.sh +++ b/setup.sh @@ -45,6 +45,13 @@ fi echo "[setup] Harness source: $HARNESS_SRC" +# --- Ensure git repo exists --- +if ! git rev-parse --git-dir &>/dev/null; then + echo "[setup] No git repo found. Initializing..." + git init + git checkout -b main 2>/dev/null || true +fi + # --- Scaffold .loop/ --- PROJECT_ROOT="$(pwd)" LOOP_DIR="$PROJECT_ROOT/.loop"