Skip to content

fix: Fix crash & update UI when current head no longer exists#188

Merged
dotdash merged 2 commits into
Cretezy:mainfrom
Edgpaez:fix-changing-current-head
Dec 7, 2025
Merged

fix: Fix crash & update UI when current head no longer exists#188
dotdash merged 2 commits into
Cretezy:mainfrom
Edgpaez:fix-changing-current-head

Conversation

@Edgpaez

@Edgpaez Edgpaez commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

When doing a fetch that removes the current head (for instance because you were in a branch that is merged) or issuing a jj command in a different window that causes the current head to disappear (because it was empty), we currently crash when trying to find the latest version of that head.

The problem is that jj log --no-graph -r luwt fails if luwt does not exist. However, after #181 we do jj log --no-graph -r 'change_id(luwt)' that simply returns empty if luwt does not exists.

This fixes this by checking the output was not empty and using set_head to update the UI

@Edgpaez Edgpaez changed the title Fix changing current head fix: Fix crash & update UI when current head no longer exists Dec 3, 2025
@dotdash
dotdash merged commit 0015d49 into Cretezy:main Dec 7, 2025
10 checks passed
@Edgpaez
Edgpaez deleted the fix-changing-current-head branch January 10, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants