Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset conflicted files #10854

Merged

Conversation

gerhardol
Copy link
Member

@gerhardol gerhardol commented Apr 2, 2023

Depends on #10852 - no behavior dependency but (assumed in code comments, the behavior when resetting will be hard to describe without #10852 too.
Depends on #10853 - no behavior dependency but the same files are changed.

First commit is not be reviewed in this PR.
Set to draft due to dependency but reviewable.

Fixes #10423 (where both are modified)
Does not handle #10470 that relates to added/removed files

Proposed changes

It was only possible to reset changes to the Index item, the error occurred when resetting the worktree file status item.
The reset must be done to HEAD.

Same behavior in worktree and index, separate implementations.

Test methodology

Manual

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned gerhardol Apr 2, 2023
@gerhardol gerhardol changed the title Feature/i10423 reset conflicted Reset conflicted files Apr 3, 2023
Special handling must be applied to reseting conflicted files
in worktree, as they must be reset to HEAD as index is just a status marker.
@gerhardol gerhardol force-pushed the feature/i10423-reset-conflicted branch from eb982d6 to 76fbdf9 Compare April 6, 2023 20:26
@gerhardol gerhardol marked this pull request as ready for review April 6, 2023 20:26
@gerhardol
Copy link
Member Author

Rebased after #10853, no longer draft

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

Looks sensible

@gerhardol gerhardol requested a review from RussKie April 10, 2023 12:58
@gerhardol gerhardol added this to the 4.1 milestone Apr 10, 2023
Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

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

LGTM

@gerhardol gerhardol changed the base branch from master to release/4.1 April 11, 2023 10:48
@RussKie RussKie merged commit e68c983 into gitextensions:release/4.1 Apr 11, 2023
2 checks passed
@gerhardol gerhardol deleted the feature/i10423-reset-conflicted branch April 11, 2023 12:05
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.

[NBug] Resetting unstaged part of conflicted file throws error
3 participants