From 87ea9102f0f3b71de7ffcf15ca5a19f9350df904 Mon Sep 17 00:00:00 2001 From: Benjamin Tan Date: Thu, 2 May 2024 16:29:31 +0800 Subject: [PATCH] repo: add `MutableRepo::merge_index` --- lib/src/repo.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/repo.rs b/lib/src/repo.rs index dc8f28e40..58d40b90d 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -1564,6 +1564,10 @@ impl MutableRepo { self.view.mark_dirty(); } + pub fn merge_index(&mut self, other_repo: &ReadonlyRepo) { + self.index.merge_in(other_repo.readonly_index()); + } + fn merge_view(&mut self, base: &View, other: &View) { // Merge working-copy commits. If there's a conflict, we keep the self side. for (workspace_id, base_wc_commit) in base.wc_commit_ids() {