mirror of
https://github.com/imjasonh/infinite-git
synced 2026-07-17 06:11:50 +00:00
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>
This commit is contained in:
parent
fefad053a8
commit
30ca57dae3
19 changed files with 2172 additions and 0 deletions
52
test.sh
Executable file
52
test.sh
Executable file
|
|
@ -0,0 +1,52 @@
|
|||
#!/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!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue