Skip to content

Commit

Permalink
fix panic displaying delete/delete conflicts, which have no diff
Browse files Browse the repository at this point in the history
  • Loading branch information
gulbanana committed Aug 28, 2024
1 parent 3b886df commit f58057c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This version is based on Jujutsu 0.20.
- `gg.queries.log-page-size` setting was not being respected.
- Removed <CR> character which rendered as a circle in the author display on some Linux systems.
- Improved button/control font display on Linux.
- Fixed a panic attempting to display delete/delete conflicts in the right pane.

## [0.18.0](releases/tag/v0.18.0)
This version is based on Jujutsu 0.18.
Expand Down
10 changes: 6 additions & 4 deletions src-tauri/src/worker/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,12 @@ pub fn query_revision(ws: &WorkspaceSession, id: RevId) -> Result<RevResult> {
MaterializedTreeValue::Conflict { contents, .. } => {
let mut hunks = get_unified_hunks(3, &contents, &[])?;

conflicts.push(RevConflict {
path: ws.format_path(path),
hunk: hunks.pop().unwrap(),
});
if let Some(hunk) = hunks.pop() {
conflicts.push(RevConflict {
path: ws.format_path(path),
hunk,
});
}
}
_ => {
log::warn!("nonresolved tree entry did not materialise as conflict");
Expand Down

0 comments on commit f58057c

Please sign in to comment.