repository: deduplicate error handling in checkForOtherLocks

This commit is contained in:
Michael Eischer
2026-06-08 21:22:12 +02:00
parent b7f3a1367a
commit 5989671f87
+1 -5
View File
@@ -185,11 +185,7 @@ func (l *lockHandle) checkForOtherLocks(ctx context.Context) error {
return err
}
if l.Exclusive {
return &alreadyLockedError{otherLock: lock}
}
if !l.Exclusive && lock.Exclusive {
if l.Exclusive || lock.Exclusive {
return &alreadyLockedError{otherLock: lock}
}