Skip to content

fix(view): refresh tracked HEAD when right is STAGE#112

Merged
dlyongemallo merged 1 commit intomainfrom
refresh_tracked_head
Apr 14, 2026
Merged

fix(view): refresh tracked HEAD when right is STAGE#112
dlyongemallo merged 1 commit intomainfrom
refresh_tracked_head

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 14, 2026 16:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes DiffView’s rev refresh behavior so that when the left side is tracking HEAD, it will refresh to the new HEAD even if the right side is STAGE (cached/staged view), preventing diffs from being computed against a stale base commit.

Changes:

  • Update DiffView.update_files() to refresh the tracked HEAD rev whenever self.left.track_head is set (no longer gated on right being LOCAL).
  • Add a functional regression test that reproduces the stale-HEAD issue for cached/staged views and asserts left updates after a commit.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lua/diffview/scene/views/diff/diff_view.lua Refresh tracked HEAD regardless of right-side rev type, fixing staged/cached views keeping a stale left base.
lua/diffview/tests/functional/diff_view_spec.lua Adds regression test ensuring left updates when HEAD moves while a right=STAGE view remains open.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dlyongemallo dlyongemallo merged commit ddfbda3 into main Apr 14, 2026
6 checks passed
@dlyongemallo dlyongemallo deleted the refresh_tracked_head branch April 14, 2026 17:04
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.

2 participants