Skip to content

Conversation

@mtsgrd
Copy link
Contributor

@mtsgrd mtsgrd commented Feb 1, 2026

Handle cases where commits contain duplicate parent IDs (produced by
older GitButler code) by filtering parent_ids through a HashSet before
constructing Commit values. This prevents mismatched parent lists that
caused errors like "Parents for commit ... do not match" during
operations such as commit_move_changes_between. The change applies
deduplication in two places: when building a Commit fallback in walk.rs
and when assembling parent_ids for newly created Commit values.

Handle cases where commits contain duplicate parent IDs (produced by
older GitButler code) by filtering parent_ids through a HashSet before
constructing Commit values. This prevents mismatched parent lists that
caused errors like "Parents for commit ... do not match" during
operations such as commit_move_changes_between. The change applies
deduplication in two places: when building a Commit fallback in walk.rs
and when assembling parent_ids for newly created Commit values.
@vercel
Copy link

vercel bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Ignored Ignored Feb 1, 2026 9:25pm

Request Review

@github-actions github-actions bot added the rust Pull requests that update Rust code label Feb 1, 2026
Copy link
Collaborator

@Byron Byron left a comment

Choose a reason for hiding this comment

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

In general, we can't change the order of the commits even if deduplicated.
I think a test should be very possible as well, and if Git doesn't want to do it, git hash-object will.

Lastly, while pondering over this a little, I came up with "it should be good to change this here as it should never be intended to have such duplicates.

Blocking merge while test is missing, and while I would hope that the deduplication might only have to happen in one of these spots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants