MCPcopy Create free account
hub / github.com/git-bug/git-bug / LoadPersistedClock

Function LoadPersistedClock

util/lamport/persisted_clock.go:38–50  ·  view source on GitHub ↗

LoadPersistedClock load a persisted Lamport clock from a file

(root billy.Filesystem, filePath string)

Source from the content-addressed store, hash-verified

36
37// LoadPersistedClock load a persisted Lamport clock from a file
38func LoadPersistedClock(root billy.Filesystem, filePath string) (*PersistedClock, error) {
39 clock := &PersistedClock{
40 root: root,
41 filePath: filePath,
42 }
43
44 err := clock.read()
45 if err != nil {
46 return nil, err
47 }
48
49 return clock, nil
50}
51
52// Increment is used to return the value of the lamport clock and increment it afterwards
53func (pc *PersistedClock) Increment() (Time, error) {

Callers 2

AllClocksMethod · 0.92
getClockMethod · 0.92

Calls 1

readMethod · 0.95

Tested by

no test coverage detected