diff --git a/lib/src/view.rs b/lib/src/view.rs index 50dfd15b2..b1801a637 100644 --- a/lib/src/view.rs +++ b/lib/src/view.rs @@ -40,11 +40,6 @@ impl View { } } - // TODO: Delete this function - pub fn checkout(&self) -> &CommitId { - self.get_checkout(&WorkspaceId::default()).unwrap() - } - pub fn checkouts(&self) -> &HashMap { &self.data.checkouts } diff --git a/lib/tests/test_init.rs b/lib/tests/test_init.rs index 97f1f80c1..966febae4 100644 --- a/lib/tests/test_init.rs +++ b/lib/tests/test_init.rs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +use jujutsu_lib::op_store::WorkspaceId; use jujutsu_lib::settings::UserSettings; use jujutsu_lib::testutils; use jujutsu_lib::workspace::Workspace; @@ -73,7 +74,7 @@ fn test_init_no_config_set(use_git: bool) { let settings = UserSettings::from_config(config::Config::new()); let test_workspace = testutils::init_workspace(&settings, use_git); let repo = &test_workspace.repo; - let checkout_id = repo.view().checkout(); + let checkout_id = repo.view().get_checkout(&WorkspaceId::default()).unwrap(); let checkout_commit = repo.store().get_commit(checkout_id).unwrap(); assert_eq!( checkout_commit.author().name, @@ -100,7 +101,8 @@ fn test_init_checkout(use_git: bool) { let settings = testutils::user_settings(); let test_workspace = testutils::init_workspace(&settings, use_git); let repo = &test_workspace.repo; - let checkout_commit = repo.store().get_commit(repo.view().checkout()).unwrap(); + let checkout_id = repo.view().get_checkout(&WorkspaceId::default()).unwrap(); + let checkout_commit = repo.store().get_commit(checkout_id).unwrap(); assert_eq!(checkout_commit.tree().id(), repo.store().empty_tree_id()); assert_eq!(checkout_commit.store_commit().parents, vec![]); assert_eq!(checkout_commit.predecessors(), vec![]); diff --git a/lib/tests/test_working_copy.rs b/lib/tests/test_working_copy.rs index 5ff252270..02d615b05 100644 --- a/lib/tests/test_working_copy.rs +++ b/lib/tests/test_working_copy.rs @@ -21,6 +21,7 @@ use std::sync::Arc; use itertools::Itertools; use jujutsu_lib::backend::{Conflict, ConflictPart, TreeValue}; use jujutsu_lib::commit_builder::CommitBuilder; +use jujutsu_lib::op_store::WorkspaceId; use jujutsu_lib::repo::ReadonlyRepo; use jujutsu_lib::repo_path::{RepoPath, RepoPathComponent}; use jujutsu_lib::settings::UserSettings; @@ -40,7 +41,8 @@ fn test_root(use_git: bool) { let mut locked_wc = wc.start_mutation(); let new_tree_id = locked_wc.write_tree(); locked_wc.discard(); - let checkout_commit = repo.store().get_commit(repo.view().checkout()).unwrap(); + let checkout_id = repo.view().get_checkout(&WorkspaceId::default()).unwrap(); + let checkout_commit = repo.store().get_commit(checkout_id).unwrap(); assert_eq!(&new_tree_id, checkout_commit.tree().id()); assert_eq!(&new_tree_id, repo.store().empty_tree_id()); }