Skip to content

The stashes with parent commits older than the oldest stash are not visible on branches #4401

Closed
@sergeibbb

Description

@sergeibbb

Description

It's related to #4353 but it's not a new problem. It has rather been uncovered by those changes.

The problem

The stashes with parent commits older than the oldest stash are not visible on branches in Repository view

Steps to reproduce

  1. delete all stashes or have a fresh repository
  2. create a branch and checkout to it
  3. make some changes and stash them
  4. enable stashes on Repository view
    Image
  5. go to the Repository view

Expected result
You see your new stash on your branch

Actual result
You don't see the stash

Explanation

The date of the stash that we look at in stash.ts is not that date that we want to use to the refs that we want to find. It should be the date of the parent commit of the oldest stash rather than the date of the stash itself.

Possible solution

Rather than look for an oldest stash we should look for a stash with an oldest parent commit.

Verification steps

Graph structure:

Before the fix:

After the fix:

GitLens Version

2025.6.1405

VS Code Version

No response

Git Version

No response

Logs, Screenshots, Screen Captures, etc

No response

Metadata

Metadata

Assignees

Labels

area-viewsIssues or features related to (tree) viewspending-releaseResolved but not yet released to the stable editionverified ✔Verified

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions