1
0
Fork 0
mirror of https://github.com/imjasonh/infinite-git synced 2026-07-08 17:15:37 +00:00
infinite-git/test.sh
Jason Hall 30ca57dae3
Implement infinite Git HTTP server
This server generates a new commit every time someone pulls from it.
Features:
- Pure Go implementation of Git object format and protocols
- No dependency on git CLI commands
- Thread-safe commit generation
- Read-only Git HTTP smart protocol support
- Comprehensive test suite

Each pull creates a new commit with a unique file containing a timestamp
and counter, making the repository grow infinitely with each pull operation.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 21:19:02 -04:00

52 lines
No EOL
827 B
Bash
Executable file

#!/bin/bash
set -e
# Cleanup function
cleanup() {
echo "Cleaning up..."
if [ -n "$SERVER_PID" ]; then
kill $SERVER_PID 2>/dev/null || true
fi
}
# Trap EXIT to ensure cleanup happens
trap cleanup EXIT
echo "Starting infinite-git server..."
go run . -addr :9876 -repo /tmp/test-infinite-git &
SERVER_PID=$!
# Give server time to start
sleep 2
# Create test directory
TEST_DIR=$(mktemp -d)
cd "$TEST_DIR"
echo "Cloning repository..."
git clone http://localhost:9876 test-repo
cd test-repo
echo "Initial clone complete. Files:"
ls -la
echo "Pulling again..."
git pull
echo "Files after first pull:"
ls -la
echo "Pulling once more..."
git pull
echo "Files after second pull:"
ls -la
echo "Checking commits..."
git log --oneline
# Test directory cleanup
cd /
rm -rf "$TEST_DIR"
echo "Test complete!"