@@ -1050,13 +1050,6 @@ def generate_live_patch(
10501050 web_commit_signoff_required , web_commit_signoff_required
10511051 )
10521052
1053- # FIXME: needed to add this hack to ensure that gh_pages_source_path is also present in
1054- # the modified data as GitHub needs the path as well when the branch is changed.
1055- # this needs to make clean to support making the diff operation generic as possible.
1056- if "gh_pages_source_branch" in modified_repo :
1057- gh_pages_source_path = cast (Repository , coerced_object ).gh_pages_source_path
1058- modified_repo ["gh_pages_source_path" ] = Change (gh_pages_source_path , gh_pages_source_path )
1059-
10601053 # similar fix as above for squash_merge_commit_title and squash_merge_commit_message as well
10611054 squash_merge_commit_title_present = "squash_merge_commit_title" in modified_repo
10621055 squash_merge_commit_message_present = "squash_merge_commit_message" in modified_repo
@@ -1188,6 +1181,11 @@ async def apply_live_patch(
11881181 await provider .delete_repo (org_id , unwrap (patch .current_object ).name )
11891182
11901183 case LivePatchType .CHANGE :
1184+ # if the source branch is changed, also ensure that the path is set when
1185+ if patch .changes and "gh_pages_source_branch" in patch .changes :
1186+ gh_pages_source_path = cast (Repository , patch .changes ).gh_pages_source_path
1187+ patch .changes ["gh_pages_source_path" ] = Change (gh_pages_source_path , gh_pages_source_path )
1188+
11911189 # if the source path is changed, also ensure that the branch is set when
11921190 # the branch is not changed. The branch is required by GitHub.
11931191 if (
0 commit comments