Skip to content
Permalink
Browse files
git-webkit pr crashes when run from detached HEAD
    https://bugs.webkit.org/show_bug.cgi?id=240468

    Reviewed by Jonathan Bedard.

    repository.branch is None when on a detached HEAD. This causes us to throw an Error when performing a regex on the branch name.
    This patch treats a detached HEAD the same as being on main.

    * Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py:
    (PullRequest.pull_request_branch_point):

Canonical link: https://commits.webkit.org/250961@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
kmiller68 committed May 25, 2022
1 parent f54d6f2 commit 031ba47422ef02889ca86186bbd9aa9168ddb693
Showing 1 changed file with 1 addition and 1 deletion.
@@ -159,7 +159,7 @@ def pull_request_branch_point(cls, repository, args, **kwargs):
# FIXME: We can do better by infering the remote from the branch point, if it's not specified
source_remote = args.remote or 'origin'

if repository.branch in repository.DEFAULT_BRANCHES or repository.PROD_BRANCHES.match(repository.branch):
if repository.branch is None or repository.branch in repository.DEFAULT_BRANCHES or repository.PROD_BRANCHES.match(repository.branch):
if Branch.main(
args, repository,
why="'{}' is not a pull request branch".format(repository.branch),

0 comments on commit 031ba47

Please sign in to comment.