In the case the branch you're updating already has the changes of the
commit you're trying to add to the pr, the cherry pick will result in no
changes, and cherry-pick --continue will fail. In this case we now
error because it's likely unexpected. Theoretically we could
--allow-empty instead, so that the commits were still squashed
together on your main branch, but I imagine it's more common that this
was an error.
I hit this case when I reverted a commit on main, and then reverted the
revert, and tried to add it to my PR, in that case the PR already had
the change from before the revert on the main branch. The fix in my case
was to first rebase my PR to get the revert, and then update the PR.
In the case the branch you're updating already has the changes of the commit you're trying to add to the pr, the cherry pick will result in no changes, and
cherry-pick --continue
will fail. In this case we now error because it's likely unexpected. Theoretically we could--allow-empty
instead, so that the commits were still squashed together on your main branch, but I imagine it's more common that this was an error.I hit this case when I reverted a commit on main, and then reverted the revert, and tried to add it to my PR, in that case the PR already had the change from before the revert on the main branch. The fix in my case was to first rebase my PR to get the revert, and then update the PR.