Skip to content

Commit

Permalink
merge_view: remove heads removed by other side also in Google repos
Browse files Browse the repository at this point in the history
When I addded the workaround in 256988d, I missed the comment
just below explaining that heads removed by the other side were
already handled. Since that's not handled when using non-default
indexes now, we need to handle it in an `else` block.
  • Loading branch information
martinvonz committed May 16, 2024
1 parent 0a39cfd commit 66aced5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1629,9 +1629,13 @@ impl MutableRepo {
if self.index.as_any().is::<DefaultMutableIndex>() {
self.record_rewrites(&base_heads, &own_heads);
self.record_rewrites(&base_heads, &other_heads);
// No need to remove heads removed by `other` because we already
// marked them abandoned or rewritten.
} else {
for removed_head in base.heads().difference(other.heads()) {
self.view_mut().remove_head(removed_head);
}
}
// No need to remove heads removed by `other` because we already marked them
// abandoned or rewritten.
for added_head in other.heads().difference(base.heads()) {
self.view_mut().add_head(added_head);
}
Expand Down

0 comments on commit 66aced5

Please sign in to comment.