mirror of
https://github.com/imjasonh/infinite-git
synced 2026-07-09 01:25:33 +00:00
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>
21 lines
394 B
Go
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
|
|
}
|