(&self, sha: &str)
| 3025 | |
| 3026 | impl GitCommitClosureTxnT for ReadTxn { |
| 3027 | fn get_git_commit_closure(&self, sha: &str) -> PristineResult<Option<Vec<Hash>>> { |
| 3028 | let table = match self.txn.open_table(GIT_COMMIT_CLOSURES) { |
| 3029 | Ok(table) => table, |
| 3030 | Err(redb::TableError::TableDoesNotExist(_)) => return Ok(None), |
| 3031 | Err(error) => return Err(PristineError::from(error)), |
| 3032 | }; |
| 3033 | match table.get(sha)? { |
| 3034 | Some(bytes) => { |
| 3035 | let nodes = match self.txn.open_table(GIT_CLOSURE_NODES) { |
| 3036 | Ok(table) => Some(table), |
| 3037 | Err(redb::TableError::TableDoesNotExist(_)) => None, |
| 3038 | Err(error) => return Err(error.into()), |
| 3039 | }; |
| 3040 | crate::pristine::git_closure::decode(bytes.value(), |id| match &nodes { |
| 3041 | Some(table) => Ok(table.get(id)?.map(|value| *value.value())), |
| 3042 | None => Ok(None), |
| 3043 | }) |
| 3044 | .map(Some) |
| 3045 | } |
| 3046 | None => Ok(None), |
| 3047 | } |
| 3048 | } |
| 3049 | |
| 3050 | fn has_git_commit_closure(&self, sha: &str) -> PristineResult<bool> { |
| 3051 | let table = match self.txn.open_table(GIT_COMMIT_CLOSURES) { |
no test coverage detected