1
0
Fork 0
mirror of https://github.com/imjasonh/infinite-git synced 2026-07-09 09:29:09 +00:00
infinite-git/internal/object/blob.go
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

21 lines
394 B
Go

package object
// Blob represents a Git blob object (file content).
type Blob struct {
Content []byte
}
// NewBlob creates a new blob object.
func NewBlob(content []byte) *Blob {
return &Blob{Content: content}
}
// Type returns the object type.
func (b *Blob) Type() Type {
return TypeBlob
}
// Serialize returns the blob content.
func (b *Blob) Serialize() []byte {
return b.Content
}