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

Method GetOrCreateClock

repository/mock_repo.go:420–431  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

418}
419
420func (r *mockRepoClock) GetOrCreateClock(name string) (lamport.Clock, error) {
421 r.mu.Lock()
422 defer r.mu.Unlock()
423
424 if c, ok := r.clocks[name]; ok {
425 return c, nil
426 }
427
428 c := lamport.NewMemClock()
429 r.clocks[name] = c
430 return c, nil
431}
432
433func (r *mockRepoClock) Increment(name string) (lamport.Time, error) {
434 c, err := r.GetOrCreateClock(name)

Callers 2

IncrementMethod · 0.95
WitnessMethod · 0.95

Calls 2

NewMemClockFunction · 0.92
LockMethod · 0.65

Tested by

no test coverage detected