From 66aced5dc86e46e9c7af07e534bd1811d5872de6 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 15 May 2024 17:16:31 -0700 Subject: [PATCH] merge_view: remove heads removed by other side also in Google repos When I addded the workaround in 256988de65de, 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. --- lib/src/repo.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/src/repo.rs b/lib/src/repo.rs index 497274dab9..5e129a5333 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -1629,9 +1629,13 @@ impl MutableRepo { if self.index.as_any().is::() { 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); }