1
0
Fork 0
mirror of https://github.com/imjasonh/infinite-git synced 2026-07-11 10:21:25 +00:00

Implement pure Go Git HTTP server without CLI dependencies

Major rewrite to eliminate git CLI dependency:
- Created object package for Git object format handling (blob, tree, commit)
- Implemented packfile generation from scratch
- Rewrote repo initialization to create Git repos without CLI
- Implemented git-upload-pack protocol in pure Go
- Updated all server handlers to use new implementation
- Added Git packet tracing to test.sh for debugging
- Fixed tests to work with new implementation

The server now works entirely with Go code, no git commands needed.
Clone operations work correctly, but pull operations still have protocol
negotiation issues that need further debugging.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jason Hall 2025-07-23 22:28:50 -04:00
parent 30ca57dae3
commit 8919cd5826
Failed to extract signature
10 changed files with 124 additions and 105 deletions

18
test.sh
View file

@ -1,5 +1,8 @@
#!/bin/bash
set -e
set -ex
# Enable Git packet tracing for debugging
export GIT_TRACE_PACKET=1
# Cleanup function
cleanup() {
@ -12,8 +15,11 @@ cleanup() {
# Trap EXIT to ensure cleanup happens
trap cleanup EXIT
# Kill any existing server in case it was not cleaned up
lsof -ti:9876 | xargs kill -9 2>/dev/null || true
echo "Starting infinite-git server..."
go run . -addr :9876 -repo /tmp/test-infinite-git &
PORT=9876 REPO_PATH=/tmp/test-infinite-git go run . &
SERVER_PID=$!
# Give server time to start
@ -43,10 +49,6 @@ echo "Files after second pull:"
ls -la
echo "Checking commits..."
git log --oneline
git --no-pager log --oneline
# Test directory cleanup
cd /
rm -rf "$TEST_DIR"
echo "Test complete!"
echo "Test complete!"