Skip to content

[Bug] No-Verify does not work when resolving merge conflicts #2707

Description

@dvdmlln

Describe the bug

When a merge stops because of conflicts and I finish the merge from the Local Changes
view, the "No Verify" option has no effect: the pre-commit / commit-msg hooks are still
executed and can abort the commit.

For a normal (non-merge) commit the same checkbox works exactly as expected — the hooks
are skipped.

Steps to reproduce

  1. Use a repository that has an active pre-commit (and/or commit-msg) hook.
  2. Merge a branch into the current branch so that merge conflicts occur.
  3. Resolve the conflicts locally and stage the resolved files.
  4. In the Local Changes view, enable the No Verify option and commit.
  5. Observe the command log / output.

Expected behavior

The commit is created with --no-verify, so pre-commit and commit-msg hooks are
skipped — the same as for a regular commit.

Actual behavior

The hooks are executed. If a hook exits with a non-zero status, the commit fails, and
there is no way to finish the merge from the UI without disabling the hooks manually.

Possible cause (by Claude)

src/Commands/Commit.cs appends --no-verify correctly, so the flag itself seems fine.
The problem looks like it is in the code path used while a merge is in progress
(InProgressContext / the "Continue" flow in the Local Changes view), which appears to
finish the merge without forwarding the current value of the No Verify option.

Note that git merge --continue has no --no-verify equivalent — it always runs the
hooks. To honour the option, the merge has to be concluded with
git commit --no-verify instead.

Activity

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

Metadata

Metadata

Assignees

Labels

already-doneThis feature already exists

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions