Inspect the complete closure before acquiring a reentrant operation lock.
(&self, roots: &[Hash])
| 41 | impl Repository { |
| 42 | // Inspect the complete closure before acquiring a reentrant operation lock. |
| 43 | fn span_in_closure(&self, roots: &[Hash]) -> Result<bool, RepositoryError> { |
| 44 | let mut pending = roots.to_vec(); |
| 45 | let mut seen = HashSet::new(); |
| 46 | let mut has_spans = false; |
| 47 | while let Some(hash) = pending.pop() { |
| 48 | if !seen.insert(hash) { |
| 49 | continue; |
| 50 | } |
| 51 | let change = self.load_change(&hash)?; |
| 52 | has_spans |= change.hashed.span.is_some(); |
| 53 | pending.extend_from_slice(change.dependencies()); |
| 54 | } |
| 55 | Ok(has_spans) |
| 56 | } |
| 57 | |
| 58 | // Simulate the entire closure in an aborted transaction before preparing |
| 59 | // any operation. This validates incoming indexes and the prospective |
no test coverage detected