Skip to content

Fix cherry-picking a range selection of commits#5599

Merged
stefanhaller merged 3 commits into
masterfrom
fix-copy-range-of-commits
May 9, 2026
Merged

Fix cherry-picking a range selection of commits#5599
stefanhaller merged 3 commits into
masterfrom
fix-copy-range-of-commits

Conversation

@stefanhaller
Copy link
Copy Markdown
Collaborator

After cherry-picking a commit, copying a range-selection of commits was broken in that it would copy only the last selected commit rather than all of them.

After a successful paste, the "X commits copied" indicator hides and
DidPaste is set, but the buffer is not cleared. If the user then
range-selects multiple commits and presses shift+C, every Add() call
rebuilds the set via SelectedHashSet(), which returns empty while
DidPaste is true; each iteration of the copy loop therefore overwrites
the previous one and only the last commit in the range survives.
After a successful paste DidPaste is true, hiding the "X commits copied"
indicator but leaving the buffer populated. From the user's perspective
this looks like a clean slate, so a new shift+C should start fresh. It is
important to reset DidPaste first, before populating the buffer with the new
commits, because otherwise each loop iteration would overwrite the previous one
since Add() rebuilds the set via SelectedHashSet() which returns empty while
DidPaste is set.
@stefanhaller stefanhaller added the bug Something isn't working label May 9, 2026
@stefanhaller stefanhaller enabled auto-merge May 9, 2026 12:06
@stefanhaller stefanhaller merged commit 88c540d into master May 9, 2026
14 checks passed
@stefanhaller stefanhaller deleted the fix-copy-range-of-commits branch May 9, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant