#!/usr/bin/env bash
set -euo pipefail
# Run from a checkout of main with the scenario runner and dependencies installed.
# Apply inherited-git-dir-runner.patch and copy inherited-git-dir.e2e.ts to scripts/scenarios/.
fixture=$(mktemp -d)
mkdir "$fixture/inherited-other"
git -C "$fixture/inherited-other" init -q -b wrong-repository-branch
git -C "$fixture/inherited-other" -c user.name=Scenario -c user.email=scenario@example.invalid commit -q --allow-empty -m 'Initial commit'
git -C "$fixture/inherited-other" branch inherited-only-branch
T3CODE_DEV_SEED=0 T3_SCENARIO_INHERITED_GIT_DIR="$fixture/inherited-other/.git" \
  vp run scenarios:prove scripts/scenarios/inherited-git-dir.e2e.ts \
  --base ee90bdc9405d8d4b8ff78ce2133ccb04844298ab \
  --head 79f4643f507da55dd2d2d58f39c9b8d02e528b64
