Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotGitRepository is returned when a directory is not inside a git repository ErrNotGitRepository = errors.New("not a git repository") )
Functions ¶
This section is empty.
Types ¶
type Detector ¶
type Detector interface {
// DetectRepository checks if the given directory is inside a git repository
// and returns information about the repository if found.
// Returns ErrNotGitRepository if not inside a git repository.
DetectRepository(ctx context.Context, dir string) (*RepositoryInfo, error)
}
Detector provides methods for detecting and analyzing git repositories
type Executor ¶
type Executor interface {
// Output executes a git command in the specified directory and returns its standard output
Output(ctx context.Context, dir string, args ...string) ([]byte, error)
}
Executor provides an interface for executing git commands
type RepositoryInfo ¶
type RepositoryInfo struct {
// RootDir is the absolute path to the repository root
RootDir string
// RemoteURL is the URL of the origin remote (empty if no remote)
RemoteURL string
// RelativePath is the relative path from repository root to the queried directory
RelativePath string
}
RepositoryInfo contains information about a git repository
Click to show internal directories.
Click to hide internal directories.