Title: [294805] trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py
Revision
294805
Author
keith_mil...@apple.com
Date
2022-05-25 10:43:05 -0700 (Wed, 25 May 2022)

Log Message

    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

Modified Paths

Diff

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py (294804 => 294805)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py	2022-05-25 17:29:16 UTC (rev 294804)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py	2022-05-25 17:43:05 UTC (rev 294805)
@@ -159,7 +159,7 @@
         # 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),
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to