Commit 6d20d47
Fix inter-branch-merge to create proper merge commit when using ResetToTargetPaths
When ResetToTargetPaths is configured, the script creates the merge branch
from the source branch HEAD and only resets specified files to the target
branch. This means the merge branch is missing all target-only content
(APIs, platform fixes, version updates, etc.) — it's a linear commit off
source, not a real merge.
This causes:
- Build failures from missing target branch fixes (nullable annotations,
platform version mismatches, etc.)
- Merge conflicts when the PR is completed because the target branch's
changes were never incorporated
The fix creates a proper merge commit when ResetToTargetPaths is used:
1. Start the merge branch from the target branch (not source)
2. Merge source into it with --no-ff to create a merge commit
3. Use -X theirs to auto-resolve conflicts (ResetToTargetPaths will
overwrite target-wins files in the next step anyway)
4. Then apply ResetToTargetPaths as before
Without ResetToTargetPaths, the original behavior is preserved — the
branch is created from source and GitHub's merge button does the merge.
Discovered in dotnet/maui PR #34789 where the main→net11.0 merge was
missing all net11.0-specific content (Directory.Build.props TFMs,
nullable fixes, PublicAPI entries) because the script never merged
net11.0 into the branch.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 0a948ff commit 6d20d47
1 file changed
Lines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 129 | | |
135 | 130 | | |
136 | 131 | | |
| |||
181 | 176 | | |
182 | 177 | | |
183 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | 223 | | |
225 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
226 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
230 | 245 | | |
231 | 246 | | |
232 | 247 | | |
| |||
0 commit comments