ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: don't call a safe function 'unsafe'

This commit is contained in:
Benjamin Saunders 2023-08-08 12:03:23 -07:00
parent 1a4cf13033
commit 7cf518a530
2 changed files with 3 additions and 3 deletions

View file

@ -845,7 +845,7 @@ impl WorkspaceCommandHelper {
self.workspace.working_copy()
}
pub fn unsafe_start_working_copy_mutation(
pub fn unchecked_start_working_copy_mutation(
&mut self,
) -> Result<(LockedWorkingCopy, Commit), CommandError> {
self.check_working_copy_writable()?;
@ -863,7 +863,7 @@ impl WorkspaceCommandHelper {
pub fn start_working_copy_mutation(
&mut self,
) -> Result<(LockedWorkingCopy, Commit), CommandError> {
let (locked_working_copy, wc_commit) = self.unsafe_start_working_copy_mutation()?;
let (locked_working_copy, wc_commit) = self.unchecked_start_working_copy_mutation()?;
if wc_commit.tree_id() != locked_working_copy.old_tree_id() {
return Err(user_error("Concurrent working copy operation. Try again."));
}

View file

@ -3616,7 +3616,7 @@ fn cmd_workspace_update_stale(
let repo = workspace_command.repo().clone();
let (mut locked_wc, desired_wc_commit) =
workspace_command.unsafe_start_working_copy_mutation()?;
workspace_command.unchecked_start_working_copy_mutation()?;
match check_stale_working_copy(&locked_wc, &desired_wc_commit, &repo) {
Ok(_) => {
locked_wc.discard();