Commit f2e08fd
committed
branch_worker: Fix _series_already_applied() helper
After a partial `git am` failure (some patches in a series apply
successfully before one hits a merge conflict), _series_already_applied()
walks commit history starting from the current HEAD. This HEAD includes
commits that were just created by the partially-successful `git am`,
so the function matches the series' own patch subjects against its own
just-applied commits and incorrectly concludes the series was "already
merged" into upstream.
The consequence is that a NewPRWithNoChangeException is raised instead of
creating a merge-conflict PR. The series remains in-queue on Patchwork
with no corresponding GitHub PR, producing a persistent KPD/Patchwork
discrepancy.
Fix this by adding an explicit `rev` parameter to
_series_already_applied() and passing it through to repo.iter_commits().
The caller now supplies the upstream remote-tracking ref
(e.g. "upstream/bpf-next"), so the history walk is anchored to the
genuine upstream branch tip rather than the working HEAD that may contain
partially-applied series commits.
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Ihor Solodrai <isolodrai@meta.com>1 parent 46ba364 commit f2e08fd
File tree
2 files changed
+15
-12
lines changed- kernel_patches_daemon
- tests
2 files changed
+15
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
| 583 | + | |
584 | 584 | | |
585 | 585 | | |
586 | | - | |
| 586 | + | |
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
| |||
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
600 | | - | |
| 600 | + | |
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
690 | | - | |
| 690 | + | |
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
| |||
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
847 | | - | |
848 | 847 | | |
849 | 848 | | |
850 | 849 | | |
| |||
1109 | 1108 | | |
1110 | 1109 | | |
1111 | 1110 | | |
1112 | | - | |
1113 | | - | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1114 | 1117 | | |
1115 | 1118 | | |
1116 | 1119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | | - | |
| 1018 | + | |
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
| |||
1024 | 1024 | | |
1025 | 1025 | | |
1026 | 1026 | | |
1027 | | - | |
| 1027 | + | |
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
1032 | | - | |
| 1032 | + | |
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | 1038 | | |
1039 | | - | |
| 1039 | + | |
1040 | 1040 | | |
1041 | 1041 | | |
1042 | 1042 | | |
1043 | 1043 | | |
1044 | 1044 | | |
1045 | 1045 | | |
1046 | | - | |
| 1046 | + | |
1047 | 1047 | | |
1048 | 1048 | | |
1049 | 1049 | | |
| |||
0 commit comments