Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blob ¶
type Blob struct {
*object.Blob
// SHA-1 hash of the blob.
Hash plumbing.Hash
// Size of the blob content in bytes.
Size int64
// True if this blob is not referenced by any commit.
IsOrphaned bool
// File path in the repository (empty for orphaned blobs).
Path string
// Hash of the commit (empty for orphaned blobs).
CommitHash plumbing.Hash
// Message of the commit (empty for orphaned blobs).
CommitMessage string
// Author of the commit (empty for orphaned blobs).
Author object.Signature
// Committer of the commit (empty for orphaned blobs).
Committer object.Signature
}
Blob wraps a go-git blob with additional metadata.
func (*Blob) ContentsAsString ¶
Contents of the blob as a string.
type CloneConfig ¶
CloneConfig holds configuration for clone operations.
type Repository ¶
type Repository struct {
*gogit.Repository
// Path is the filesystem path to the repository.
Path string
}
Repository wraps and embeds a go-git Repository and its local path. Embedded go-git methods are available directly on Repository.
func Clone ¶
func Clone(url, workingDir string, verbose ...bool) (*Repository, error)
Clone the repository in URL to "workingDir/repoName". If the optional verbose parameter is true, progress will be sent to stdout.
func CloneMirror ¶
func CloneMirror(url, workingDir string, verbose ...bool) (*Repository, error)
Create a bare mirror clone like "--mirror".
func CloneShallow ¶
func CloneShallow(url, workingDir string, verbose ...bool) (*Repository, error)
Create a shallow clone like "--depth=1".
func Open ¶
func Open(path string) (*Repository, error)
Opens an existing git repository at the given path and returns a Repository wrapper.
func (*Repository) AllBlobs ¶
func (r *Repository) AllBlobs() ([]*Blob, error)
AllBlobs retrieves all blob objects from the repository. Returns enhanced Blob objects including both commit-referenced and orphaned blobs.
func (*Repository) CommitBlobs ¶
func (r *Repository) CommitBlobs() ([]*Blob, error)
CommitBlobs retrieves all blob objects from the repository by walking through commits. Returns enhanced Blob objects with commit context and file path information.
func (*Repository) OrphanedBlobs ¶
func (r *Repository) OrphanedBlobs() ([]*Blob, error)
OrphanedBlobs retrieves only the orphaned blob objects from the repository. Returns enhanced Blob objects that exist in the object database but are not referenced by any commit.