Skip to content

Conversation

stefanhaller
Copy link
Collaborator

PR Description

This is similar to #2957, except that in that case it was about an explicit fast-forward command, and we solved it by doing the fast-forward in the other work-tree (so that it would fail if that worktree had modified files, for example). In this case it is about the relatively new auto-forward feature (added in v0.50, see #4493), and in this case we fix it by not even trying to auto-forward any branches that are checked out by other worktrees.

@stefanhaller stefanhaller added the bug Something isn't working label Aug 18, 2025
Copy link

codacy-production bot commented Aug 18, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 8beec9a1 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8beec9a) Report Missing Report Missing Report Missing
Head commit (235ab15) 57592 50044 86.89%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4833) 48 48 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

… worktree

The test shows that we are currently auto-forwarding branches even if they are
checked out by another worktree; this is quite bad, because when you switch to
that other worktree you'll see that the files that are touched by the fetched
commits are all modified (which we don't test here).
@stefanhaller stefanhaller force-pushed the dont-auto-forward-branches-checked-out-in-other-worktree branch from 5ad2e03 to 235ab15 Compare August 20, 2025 08:43
@stefanhaller stefanhaller enabled auto-merge August 20, 2025 08:43
@stefanhaller stefanhaller merged commit 1d65196 into master Aug 20, 2025
12 checks passed
@stefanhaller stefanhaller deleted the dont-auto-forward-branches-checked-out-in-other-worktree branch August 20, 2025 08:45
@stefanhaller stefanhaller changed the title Dont auto-forward branches that are checked out in another worktree Don't auto-forward branches that are checked out in another worktree Aug 26, 2025
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