Skip to content

Commit

Permalink
Add --empty=keep to backport command (#15028)
Browse files Browse the repository at this point in the history
If the pull request being back ported contains an empty commit, the backport command will fail during `git am` since it has not been instructed what to do with an empty commit.

This changes the backport command to preserve the empty commit.

See this pull request from `dotnet/runtime` for an example of the backport command failing in the presence of an empty commit: dotnet/runtime#106779
  • Loading branch information
vcsjones authored Aug 29, 2024
1 parent ccd33d0 commit 8ce91d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/backport-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
// download and apply patch
await exec.exec(`curl -sSL "${context.payload.issue.pull_request.patch_url}" --output changes.patch`);
const git_am_command = "git am --3way --ignore-whitespace --keep-non-patch changes.patch";
const git_am_command = "git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch";
let git_am_output = `$ ${git_am_command}\n\n`;
let git_am_failed = false;
try {
Expand Down

0 comments on commit 8ce91d7

Please sign in to comment.