git

package
v0.0.0-...-fc6af5e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRepository

func CloneRepository(url, destination, branch string) (*git.Repository, error)

CloneRepository clones a Git repository to the specified directory

func GetCommitStats

func GetCommitStats(repo *git.Repository) (int, error)

GetCommitStats gets commit statistics for the repository

Types

type Contributor

type Contributor struct {
	Name      string
	Email     string
	Commits   int
	AvatarURL string
}

Contributor represents a repository contributor

type RepositoryData

type RepositoryData struct {
	Owner       string
	Name        string
	Description string
	URL         string

	// Content
	ReadmeContent string
	ReadmePath    string
	MarkdownFiles map[string]string // path -> content

	// Stats from git
	Contributors   []Contributor
	CommitCount    int
	LastCommitDate time.Time

	// License information if available
	License string

	// Set of image paths in the repository (to copy to output)
	ImageFiles map[string]string // path -> full path on disk
}

RepositoryData contains all the information about a repository

func GetRepositoryData

func GetRepositoryData(repo *git.Repository, owner, name, repoPath string) (*RepositoryData, error)

GetRepositoryData extracts information from a cloned repository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL