Skip to content

Avoid crash in pr merge when the pull request has no commits#3036

Merged
mislav merged 3 commits intotrunkfrom
pr-merge-no-commits
Feb 26, 2021
Merged

Avoid crash in pr merge when the pull request has no commits#3036
mislav merged 3 commits intotrunkfrom
pr-merge-no-commits

Conversation

@mislav
Copy link
Contributor

@mislav mislav commented Feb 24, 2021

The bulk of the changes is restructuring tests so this case is easier to test for.

Fixes #3031
Regression from #2255

A PR is not guaranteed to have commits, it seems, so add a guard against
assuming that there is always a head commit.
We relied too much on stubs for these methods. These new tests actually
invoke `git` commands in the context of a test repository.
@mislav mislav requested a review from a team February 24, 2021 14:09
@mislav mislav merged commit 8235140 into trunk Feb 26, 2021
@mislav mislav deleted the pr-merge-no-commits branch February 26, 2021 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh pr merge panic for enterprise 2.20

2 participants