aboutsummaryrefslogtreecommitdiffstats
path: root/cache/cached.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-11-29 13:01:53 +0100
committerMichael Muré <batolettre@gmail.com>2022-11-29 13:01:53 +0100
commit4a341b5e1714a6a36ec7f5839a6a1b73571d4851 (patch)
tree261e108d1c9bd78e15e19379f611cfecb900fef5 /cache/cached.go
parent0ac39a7ab5db077fcf0df827e32bf6e625e980da (diff)
downloadgit-bug-4a341b5e1714a6a36ec7f5839a6a1b73571d4851.tar.gz
WIP
Diffstat (limited to 'cache/cached.go')
-rw-r--r--cache/cached.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cache/cached.go b/cache/cached.go
index 5e24e732..75ca58e5 100644
--- a/cache/cached.go
+++ b/cache/cached.go
@@ -104,6 +104,12 @@ func (e *CachedEntityBase[SnapT, OpT]) ResolveOperationWithMetadata(key string,
return matching[0], nil
}
+func (e *CachedEntityBase[SnapT, OpT]) Validate() error {
+ e.mu.RLock()
+ defer e.mu.RUnlock()
+ return e.entity.Validate()
+}
+
func (e *CachedEntityBase[SnapT, OpT]) Commit() error {
e.mu.Lock()
err := e.entity.Commit(e.repo)