Repository navigation
fix(view): don't hide work when the overview base is HEAD or unresolved - #361
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Both new tests can pass without successfully opening the intended DiffView.
1 open finding
What changed in this PR
Prevents worktree overview navigation from hiding uncommitted changes when the comparison base equals HEAD, and warns when no base resolves.
Changes:
- Detects when the base and
HEADreference the same commit. - Falls back to the default worktree view or emits an unresolved-base warning.
- Adds functional regression tests.
| File | Description |
|---|---|
worktree_overview_view.lua |
Handles equal or unresolved comparison bases. |
worktree_overview_view_spec.lua |
Tests equal-HEAD and unresolved-base behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+460
to
+466
| opened = require("diffview.lib").get_current_view() | ||
| assert.is_not_nil(opened) | ||
| assert.equals(repo, opened.adapter.ctx.toplevel) | ||
| -- `rev_arg` on a working-tree-vs-HEAD DiffView is nil / empty; | ||
| -- a `base...` form would set it to that string. | ||
| local rev_arg = opened.rev_arg | ||
| assert.is_true(rev_arg == nil or rev_arg == "") |
dlyongemallo
force-pushed
the
worktree_fix_empty_panel
branch
from
October 13, 2026 13:01
a880d81 to
7e269f2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fix for #334 bug.