Repository navigation
Resolve the commit to its full SHA before backporting - #201
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #200.
cherry_pickerbuilds the backport branch name from the commit SHA exactly as you typed it. When the SHA has fewer than 7 characters or contains uppercase letters,get_base_branch()rejects the branch name it just created. The command then crashes after the cherry-pick and leavescherry-picker.stateatBACKPORT_LOOP_START, which blocks--abortand--continue.Changes
backport()resolves the commit withgit rev-parse --verify <sha>^{commit}and uses the full SHA from then on. As a result, the branch name and the(cherry picked from commit ...)line always use the canonical SHA.backport()prints the Git error, resets the state, and exits before it creates a backport branch. Before this change, it created abackport-<sha>-<branch>branch, failed the cherry-pick, and left the run paused.Tests
test_backport_resolves_commit_shacovers a 6-character SHA and an uppercase SHA.test_backport_unknown_commit_shachecks that an unknown commit stops before checkout and leaves no state behind.