Unified · Split
| @@ -129,23 +129,27 @@ impl<'repo> Tree<'repo> { · 128 unmodified lines | ||
| 129 | 129 | res |
| 130 | 130 | } |
| 131 | 131 | ControlFlow::Break(entry) => { |
| 132 | − let mapped = entry.map(|e| Entry { | |
| 133 | − inner: e.into(), | |
| 134 | − repo: self.repo, | |
| 135 | − }); | |
| 136 | − if let Some(entry) = &mapped { | |
| 137 | − if entry.mode().is_tree() { | |
| 138 | − let id = entry.object_id(); | |
| 139 | − self.repo.find(&id, &mut self.data)?; | |
| 132 | + let entry = if let Some(e) = entry { | |
| 133 | + let inner = e.into(); | |
| 134 | + | |
| 135 | + if e.mode.is_tree() { | |
| 136 | + let id = e.oid.to_owned(); | |
| 140 | 137 | data_id = id; |
| 138 | + self.repo.find(&id, &mut self.data)?; | |
| 141 | 139 | self.id = data_id; |
| 142 | 140 | } |
| 143 | − } | |
| 141 | + | |
| 142 | + Some(Entry { inner, repo: self.repo }) | |
| 143 | + } else { | |
| 144 | + None | |
| 145 | + }; | |
| 146 | + | |
| 144 | 147 | if data_id != self.id { |
| 145 | 148 | // Ensure that our data always matches our id, even if this means an extra lookup. |
| 146 | 149 | self.repo.find(&self.id, &mut self.data)?; |
| 147 | 150 | } |
| 148 | − break Ok(mapped); | |
| 151 | + | |
| 152 | + break Ok(entry); | |
| 149 | 153 | } |
| 150 | 154 | } |
| 151 | 155 | } |