Skip to content

fix(reset_hunk): pass diff options to reversed diff so the correct hunk is discarded#2968

Open
Noethix55555 wants to merge 1 commit into
gitui-org:masterfrom
Noethix55555:fix/reset-hunk-options
Open

fix(reset_hunk): pass diff options to reversed diff so the correct hunk is discarded#2968
Noethix55555 wants to merge 1 commit into
gitui-org:masterfrom
Noethix55555:fix/reset-hunk-options

Conversation

@Noethix55555

Copy link
Copy Markdown

reset_hunk found the target hunk index by diffing with the caller's options, but then applied the reversed diff with None options. When non-default options (e.g. ignore_whitespace, interhunk_lines) are in use, the positional index can select the wrong hunk, corrupting the working tree.

unstage_hunk already passes options to both diffs correctly. This commit mirrors that pattern in reset_hunk.

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.

1 participant