blob: 7c3f07afd877d869207ae5a0fae83c48291dd86d (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Package files provides one Git files ref store with loose-over-packed reads
// and transaction-coordinated updates.
package files
import (
"math/rand"
"os"
"time"
objectid "codeberg.org/lindenii/furgit/object/id"
refstore "codeberg.org/lindenii/furgit/ref/store"
)
// Store reads and writes one Git files ref namespace rooted at one repository
// gitdir plus its commondir.
//
// Store borrows gitRoot and owns commonRoot. Close releases only resources
// opened by the store itself.
type Store struct {
gitRoot *os.Root
commonRoot *os.Root
algo objectid.Algorithm
lockRand *rand.Rand
packedRefsTimeout time.Duration
}
var (
_ refstore.ReadingStore = (*Store)(nil)
_ refstore.TransactionalStore = (*Store)(nil)
_ refstore.BatchStore = (*Store)(nil)
)
|