From 4777508df0ee122d7fb02f0cf326e91188d21469 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 22 Jan 2023 21:34:17 -0800 Subject: [PATCH] repo: make `check_out()` call `edit()` This reduces duplication a little, and it makes logical sense. --- lib/src/repo.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/src/repo.rs b/lib/src/repo.rs index 1a7476895..3c02fc1d7 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -747,7 +747,6 @@ impl MutableRepo { settings: &UserSettings, commit: &Commit, ) -> BackendResult { - self.leave_commit(&workspace_id); let wc_commit = self .new_commit( settings, @@ -755,8 +754,7 @@ impl MutableRepo { commit.tree_id().clone(), ) .write()?; - self.set_wc_commit(workspace_id, wc_commit.id().clone()) - .unwrap(); + self.edit(workspace_id, &wc_commit).unwrap(); Ok(wc_commit) }