Skip to content

fix(ng-dev/pr): reset uncommitted changes after merge attempt#3788

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix/merge-tool-reset-changes
Jun 16, 2026
Merged

fix(ng-dev/pr): reset uncommitted changes after merge attempt#3788
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix/merge-tool-reset-changes

Conversation

@alan-agius4

Copy link
Copy Markdown
Contributor

Ensure that the repository is cleaned up by resetting any uncommitted changes in the finally block of the merge tool.

This can happen because pnpm may install the dependencies of the target branch to run pre-commit hooks, which can cause the lockfile to be updated and leave the repository in a dirty state. Resetting the changes ensures a clean state before switching back to the previous branch.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds a hard reset step in the merge tool's finally block to clean up any uncommitted changes, such as lockfile updates from pre-commit hooks. The feedback suggests using runGraceful instead of run for the git reset command to prevent a potential failure from blocking the rest of the cleanup process.

Comment thread ng-dev/pr/merge/merge-tool.ts Outdated
Ensure that the repository is cleaned up by resetting any uncommitted changes in the finally block of the merge tool.

This can happen because pnpm may install the dependencies of the target branch to run pre-commit hooks, which can cause the lockfile to be updated and leave the repository in a dirty state. Resetting the changes ensures a clean state before switching back to the previous branch.
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Jun 16, 2026
@alan-agius4 alan-agius4 force-pushed the fix/merge-tool-reset-changes branch from 0fce864 to 0c2fb41 Compare June 16, 2026 07:46

@josephperrott josephperrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@alan-agius4 alan-agius4 merged commit e9faacd into angular:main Jun 16, 2026
16 checks passed
@alan-agius4

Copy link
Copy Markdown
Contributor Author

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4 alan-agius4 deleted the fix/merge-tool-reset-changes branch June 16, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants