diff --git a/cli/src/commands/operation/diff.rs b/cli/src/commands/operation/diff.rs index 84ee6e706f..7b9b32a5b2 100644 --- a/cli/src/commands/operation/diff.rs +++ b/cli/src/commands/operation/diff.rs @@ -556,7 +556,9 @@ fn show_change_diff( width: usize, ) -> Result<(), CommandError> { match (&*change.removed_commits, &*change.added_commits) { - (predecessors @ [_], [commit]) => { + (predecessors @ ([] | [_]), [commit]) => { + // New or modified change. If the modification involved a rebase, + // show diffs from the rebased tree. let predecessor_tree = rebase_to_dest_parent(repo, predecessors, commit)?; let tree = commit.tree()?; diff_renderer.show_diff( @@ -568,9 +570,6 @@ fn show_change_diff( width, )?; } - ([], [commit]) => { - diff_renderer.show_patch(ui, formatter, commit, &EverythingMatcher, width)?; - } ([commit], []) => { // TODO: Should we show a reverse diff? diff_renderer.show_patch(ui, formatter, commit, &EverythingMatcher, width)?;