Skip to content

Commit

Permalink
When running git cherry-pick, pass the -x flag to make sure that …
Browse files Browse the repository at this point in the history
…the "cherry picked from commit ..." line is appended to the end of the commit message (#75)
  • Loading branch information
DilumAluthge authored Dec 5, 2021
1 parent 98051d9 commit 2273384
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const backportOnce = async ({
await git("switch", base);
await git("switch", "--create", head);
try {
await git("cherry-pick", commitToBackport);
await git("cherry-pick", "-x", commitToBackport);
} catch (error: unknown) {
await git("cherry-pick", "--abort");
throw error;
Expand Down Expand Up @@ -162,7 +162,7 @@ const getFailedBackportCommentBody = ({
"# Create a new branch",
`git switch --create ${head}`,
"# Cherry-pick the merged commit of this pull request and resolve the conflicts",
`git cherry-pick --mainline 1 ${commitToBackport}`,
`git cherry-pick -x --mainline 1 ${commitToBackport}`,
"# Push it to GitHub",
`git push --set-upstream origin ${head}`,
"# Go back to the original working tree",
Expand Down

0 comments on commit 2273384

Please sign in to comment.