Skip to content

Commit

Permalink
cli: don't call a safe function 'unsafe'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Aug 9, 2023
1 parent 1a4cf13 commit 7cf518a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
Expand All @@ -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."));
}
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7cf518a

Please sign in to comment.