(&self, sha: &str)
| 2996 | |
| 2997 | impl GitCommitClosureTxnT for ReadTxn { |
| 2998 | fn get_git_commit_closure(&self, sha: &str) -> PristineResult<Option<Vec<Hash>>> { |
| 2999 | let table = match self.txn.open_table(GIT_COMMIT_CLOSURES) { |
| 3000 | Ok(table) => table, |
| 3001 | Err(redb::TableError::TableDoesNotExist(_)) => return Ok(None), |
| 3002 | Err(error) => return Err(PristineError::from(error)), |
| 3003 | }; |
| 3004 | match table.get(sha)? { |
| 3005 | Some(bytes) => { |
| 3006 | let nodes = match self.txn.open_table(GIT_CLOSURE_NODES) { |
| 3007 | Ok(table) => Some(table), |
| 3008 | Err(redb::TableError::TableDoesNotExist(_)) => None, |
| 3009 | Err(error) => return Err(error.into()), |
| 3010 | }; |
| 3011 | crate::pristine::git_closure::decode(bytes.value(), |id| match &nodes { |
| 3012 | Some(table) => Ok(table.get(id)?.map(|value| *value.value())), |
| 3013 | None => Ok(None), |
| 3014 | }) |
| 3015 | .map(Some) |
| 3016 | } |
| 3017 | None => Ok(None), |
| 3018 | } |
| 3019 | } |
| 3020 | |
| 3021 | fn has_git_commit_closure(&self, sha: &str) -> PristineResult<bool> { |
| 3022 | let table = match self.txn.open_table(GIT_COMMIT_CLOSURES) { |
no test coverage detected