Documentation
¶
Index ¶
- Constants
- type Repository
- func (r *Repository) CommitObject(hash plumbing.Hash) (*object.Commit, error)
- func (r *Repository) CurrentBranch() (string, error)
- func (r *Repository) DatabasePath() string
- func (r *Repository) FileAtCommit(commit *object.Commit, path string) (string, error)
- func (r *Repository) GetDependencies(commitRef, branchName string) ([]database.Dependency, error)
- func (r *Repository) GetDependenciesWithDB(commitRef, branchName string) ([]database.Dependency, *database.DB, error)
- func (r *Repository) GetExcludeDirs() []string
- func (r *Repository) GetSubmodulePaths() ([]string, error)
- func (r *Repository) GitDir() string
- func (r *Repository) Head() (*plumbing.Reference, error)
- func (r *Repository) IndexCommitSnapshot(db *database.DB, branchID int64, sha string) error
- func (r *Repository) LoadMailmap() error
- func (r *Repository) LocalBranches() (map[string][]string, error)
- func (r *Repository) Log(from plumbing.Hash) (object.CommitIter, error)
- func (r *Repository) ResolveAuthor(name, email string) (string, string)
- func (r *Repository) ResolveRevision(rev string) (*plumbing.Hash, error)
- func (r *Repository) Tags() (map[string][]string, error)
- func (r *Repository) TreeAtCommit(commit *object.Commit) (*object.Tree, error)
- func (r *Repository) WorkDir() string
Constants ¶
const DatabaseFile = "pkgs.sqlite3"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func OpenRepository ¶
func OpenRepository(path string) (*Repository, error)
func (*Repository) CommitObject ¶
func (*Repository) CurrentBranch ¶
func (r *Repository) CurrentBranch() (string, error)
func (*Repository) DatabasePath ¶
func (r *Repository) DatabasePath() string
func (*Repository) FileAtCommit ¶
func (*Repository) GetDependencies ¶ added in v0.11.2
func (r *Repository) GetDependencies(commitRef, branchName string) ([]database.Dependency, error)
GetDependencies returns dependencies at the specified commit, indexing on demand if needed. The database is closed before returning.
func (*Repository) GetDependenciesWithDB ¶ added in v0.11.2
func (r *Repository) GetDependenciesWithDB(commitRef, branchName string) ([]database.Dependency, *database.DB, error)
GetDependenciesWithDB returns dependencies at the specified commit along with an open database handle. The caller is responsible for closing the database. This is useful for commands that need to cache enrichment data.
func (*Repository) GetExcludeDirs ¶ added in v0.13.1
func (r *Repository) GetExcludeDirs() []string
GetExcludeDirs returns directories to skip during walking, read from git config git-pkgs.exclude-dirs. Defaults to "node_modules,vendor" if unset.
func (*Repository) GetSubmodulePaths ¶ added in v0.11.5
func (r *Repository) GetSubmodulePaths() ([]string, error)
GetSubmodulePaths returns a list of submodule paths using go-git's submodule support.
func (*Repository) GitDir ¶
func (r *Repository) GitDir() string
func (*Repository) IndexCommitSnapshot ¶ added in v0.11.2
IndexCommitSnapshot analyzes a single commit and stores its snapshot.
func (*Repository) LoadMailmap ¶ added in v0.11.6
func (r *Repository) LoadMailmap() error
LoadMailmap loads the .mailmap file from the repository root if it exists. This enables author identity remapping via ResolveAuthor.
func (*Repository) LocalBranches ¶ added in v0.11.2
func (r *Repository) LocalBranches() (map[string][]string, error)
LocalBranches returns a map of commit SHA to branch names for all local branch heads.
func (*Repository) Log ¶
func (r *Repository) Log(from plumbing.Hash) (object.CommitIter, error)
func (*Repository) ResolveAuthor ¶ added in v0.11.6
func (r *Repository) ResolveAuthor(name, email string) (string, string)
ResolveAuthor maps an author's name and email to their canonical identity using the loaded .mailmap file. If no .mailmap was loaded or no mapping exists, the original values are returned unchanged.
func (*Repository) ResolveRevision ¶
func (r *Repository) ResolveRevision(rev string) (*plumbing.Hash, error)
func (*Repository) Tags ¶ added in v0.11.2
func (r *Repository) Tags() (map[string][]string, error)
Tags returns a map of commit SHA to tag names for all tags in the repository.
func (*Repository) TreeAtCommit ¶
func (*Repository) WorkDir ¶
func (r *Repository) WorkDir() string