Documentation ¶
Index ¶
- func CleanupWorktrees(ctx context.Context, repo *localrepo.Repo) error
- func FixDirectoryPermissions(ctx context.Context, path string) error
- func GetRepackGitConfig(ctx context.Context, bitmap bool) []git.ConfigPair
- func IsPoolPath(relativePath string) bool
- func RepackObjects(ctx context.Context, repo *localrepo.Repo, cfg RepackObjectsConfig) error
- func WriteCommitGraph(ctx context.Context, repo *localrepo.Repo) error
- type Manager
- type RepackObjectsConfig
- type RepositoryManager
- func (m *RepositoryManager) CleanStaleData(ctx context.Context, repo *localrepo.Repo) error
- func (m *RepositoryManager) Collect(metrics chan<- prometheus.Metric)
- func (m *RepositoryManager) Describe(descs chan<- *prometheus.Desc)
- func (m *RepositoryManager) OptimizeRepository(ctx context.Context, repo *localrepo.Repo) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupWorktrees ¶ added in v14.9.0
CleanupWorktrees cleans up stale and disconnected worktrees for the given repository.
func FixDirectoryPermissions ¶
FixDirectoryPermissions does a recursive directory walk to look for directories that cannot be accessed by the current user, and tries to fix those with chmod. The motivating problem is that directories with mode 0 break os.RemoveAll.
func GetRepackGitConfig ¶ added in v14.9.0
func GetRepackGitConfig(ctx context.Context, bitmap bool) []git.ConfigPair
GetRepackGitConfig returns configuration suitable for Git commands which write new packfiles.
func IsPoolPath ¶ added in v14.9.0
IsPoolPath returns whether the relative path indicates the repository is an object pool.
func RepackObjects ¶ added in v14.9.0
RepackObjects repacks objects in the given repository and updates the commit-graph. The way objects are repacked is determined via the RepackObjectsConfig.
func WriteCommitGraph ¶ added in v14.9.0
WriteCommitGraph updates the commit-graph in the given repository. The commit-graph is updated incrementally, except in the case where it doesn't exist yet or in case it is detected that the commit-graph is missing bloom filters.
Types ¶
type Manager ¶ added in v14.9.0
type Manager interface { // CleanStaleData removes any stale data in the repository. CleanStaleData(context.Context, *localrepo.Repo) error // OptimizeRepository optimizes the repository's data structures such that it can be more // efficiently served. OptimizeRepository(context.Context, *localrepo.Repo) error }
Manager is a housekeeping manager. It is supposed to handle housekeeping tasks for repositories such as the cleanup of unneeded files and optimizations for the repository's data structures.
type RepackObjectsConfig ¶ added in v14.9.0
type RepackObjectsConfig struct { // FullRepack determines whether all reachable objects should be repacked into a single // packfile. This is much less efficient than doing incremental repacks, which only soak up // all loose objects into a new packfile. FullRepack bool // WriteBitmap determines whether reachability bitmaps should be written or not. There is no // reason to set this to `false`, except for legacy compatibility reasons with existing RPC // behaviour WriteBitmap bool }
RepackObjectsConfig is configuration for RepackObjects.
type RepositoryManager ¶ added in v14.9.0
type RepositoryManager struct {
// contains filtered or unexported fields
}
RepositoryManager is an implementation of the Manager interface.
func NewManager ¶ added in v14.9.0
func NewManager(txManager transaction.Manager) *RepositoryManager
NewManager creates a new RepositoryManager.
func (*RepositoryManager) CleanStaleData ¶ added in v14.9.0
CleanStaleData cleans up any stale data in the repository.
func (*RepositoryManager) Collect ¶ added in v14.9.0
func (m *RepositoryManager) Collect(metrics chan<- prometheus.Metric)
Collect is used to collect Prometheus metrics.
func (*RepositoryManager) Describe ¶ added in v14.9.0
func (m *RepositoryManager) Describe(descs chan<- *prometheus.Desc)
Describe is used to describe Prometheus metrics.
func (*RepositoryManager) OptimizeRepository ¶ added in v14.9.0
OptimizeRepository performs optimizations on the repository. Whether optimizations are performed or not depends on a set of heuristics.