forked from mirrors/jj
cli: op diff: consolidate match arms of forward diffs
These two are equivalent. It's still restricted to zero or one removed commits because I'm not sure how diverged changes should be rendered.
This commit is contained in:
parent
f7836aa687
commit
8cac8fba5a
1 changed files with 3 additions and 4 deletions
|
@ -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)?;
|
||||
|
|
Loading…
Reference in a new issue