forked from mirrors/jj
cli: don't call a safe function 'unsafe'
This commit is contained in:
parent
1a4cf13033
commit
7cf518a530
2 changed files with 3 additions and 3 deletions
|
@ -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."));
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue