SetBeforeMoveLockForTesting installs the beforeMoveLock seam (BUG-3665) for the lifetime of the returned restore function: a move calls hook after its pre-lock read of the item and before it takes the workspace lock.
(hook func(itemID string))
| 290 | // the lifetime of the returned restore function: a move calls hook after its |
| 291 | // pre-lock read of the item and before it takes the workspace lock. |
| 292 | func (s *Store) SetBeforeMoveLockForTesting(hook func(itemID string)) (restore func()) { |
| 293 | prev := s.beforeMoveLock |
| 294 | s.beforeMoveLock = hook |
| 295 | return func() { s.beforeMoveLock = prev } |
| 296 | } |
| 297 | |
| 298 | // SetBeforeItemVersionsReadHookForTesting runs hook at the start of every |
| 299 | // version-list read (ListItemVersionsPage and the snapshot read), before its |
no outgoing calls