Files
lazygitclj/test/e2e/setup-test-repo.sh
Adam Jeniski 2657545018 Add VHS e2e tests and output recordings
Includes test tapes for navigation, branch operations, stash operations,
help panel, commits, and cursor navigation. Resolved stash conflicts by
keeping simpler test versions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 11:01:11 -05:00

38 lines
835 B
Bash
Executable File

#!/bin/bash
# Setup a test git repository for e2e tests
# Usage: ./setup-test-repo.sh /tmp/test-repo
REPO_DIR="${1:-/tmp/lazygitclj-e2e-test}"
# Remove existing repo if present
rm -rf "$REPO_DIR"
# Create and initialize repo
mkdir -p "$REPO_DIR"
cd "$REPO_DIR"
git init -b main
# Configure git
git config user.email "test@example.com"
git config user.name "Test User"
# Create initial files
echo "# Test Project" > README.md
echo "line1" > file1.txt
echo "line2" > file2.txt
git add .
git commit -m "Initial commit"
# Create feature branch with changes
git checkout -b feature-branch
echo "feature content" > feature.txt
git add .
git commit -m "Add feature"
# Go back to main and make some uncommitted changes
git checkout main
echo "modified" >> file1.txt
echo "new file" > new-file.txt
echo "Test repo created at $REPO_DIR"