diff --git a/cli/src/commands/next.rs b/cli/src/commands/next.rs index f32f25b941..25d623a196 100644 --- a/cli/src/commands/next.rs +++ b/cli/src/commands/next.rs @@ -106,7 +106,6 @@ pub(crate) fn cmd_next( .get_wc_commit_id() .ok_or_else(|| user_error("This command requires a working copy"))?; let current_wc = workspace_command.repo().store().get_commit(current_wc_id)?; - let current_short = short_commit_hash(current_wc.id()); // If we're editing, start at the working-copy commit. // Otherwise start from our direct parent. let start_id = if edit { @@ -140,6 +139,7 @@ pub(crate) fn cmd_next( } commits => choose_commit(ui, &workspace_command, "next", commits)?, }; + let current_short = short_commit_hash(current_wc.id()); let target_short = short_commit_hash(target.id()); // We're editing, just move to the target commit. if edit { diff --git a/cli/src/commands/prev.rs b/cli/src/commands/prev.rs index de3d0e6487..b39409bf49 100644 --- a/cli/src/commands/prev.rs +++ b/cli/src/commands/prev.rs @@ -69,7 +69,6 @@ pub(crate) fn cmd_prev( .get_wc_commit_id() .ok_or_else(|| user_error("This command requires a working copy"))?; let current_wc = workspace_command.repo().store().get_commit(current_wc_id)?; - let current_short = short_commit_hash(current_wc.id()); let start_id = if edit { current_wc_id } else { @@ -106,6 +105,7 @@ pub(crate) fn cmd_prev( commits => choose_commit(ui, &workspace_command, "prev", commits)?, }; // Generate a short commit hash, to make it readable in the op log. + let current_short = short_commit_hash(current_wc.id()); let target_short = short_commit_hash(target.id()); // If we're editing, just move to the revision directly. if edit {