repository: deduplicate index progress bar initializaton

This commit is contained in:
Michael Eischer committed 2025-10-03 18:55:46 +02:00
1 parent b459d66288
commit 52eb66929f
21 files changed
+41 -48

No files matched your search

+7 -1
View File
@@ -21,7 +21,7 @@ type Repository interface {
Config() Config
Key() *crypto.Key
LoadIndex(ctx context.Context, p *progress.Counter) error
LoadIndex(ctx context.Context, p TerminalCounterFactory) error
SetIndex(mi MasterIndex) error
LookupBlob(t BlobType, id ID) []PackedBlob
@@ -131,6 +131,12 @@ type PackBlobs struct {
Blobs []Blob
}
type TerminalCounterFactory interface {
// NewCounterTerminalOnly returns a new progress counter that is only shown if stdout points to a
// terminal. It is not shown if --quiet or --json is specified.
NewCounterTerminalOnly(description string) *progress.Counter
}
// MasterIndex keeps track of the blobs are stored within files.
type MasterIndex interface {
Has(bh BlobHandle) bool