Skip to content

Commit

Permalink
Cherry-pick 256710@main (10e8d00). rdar://102376829
Browse files Browse the repository at this point in the history
    [check-webkit-style] Handle divergent branch state on multiple remotes
    https://bugs.webkit.org/show_bug.cgi?id=247952
    rdar://102376829

    Reviewed by Dewei Zhu.

    * Tools/Scripts/webkitpy/common/checkout/scm/git.py:
    (Git.remote_branch_ref): Attempt to only return remote branches which contain the branch point.

    Canonical link: https://commits.webkit.org/256710@main

Canonical link: https://commits.webkit.org/252432.831@safari-7614-branch
  • Loading branch information
JonWBedard committed Nov 16, 2022
1 parent dbb76fd commit 95d5bbb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tools/Scripts/webkitpy/common/checkout/scm/git.py
Expand Up @@ -559,6 +559,12 @@ def remote_branch_ref(self, find_branch=False):
repository = local.Git(self.checkout_root)
branch_point = branch.Branch.branch_point(repository, limit=10)
if branch_point:
# First, look for a remote branch that contains the branch point
for remote in repository.source_remotes():
if branch_point.branch in repository.branches_for(hash=branch_point.hash, remote=remote, cached=True):
return 'refs/remotes/{}/{}'.format(remote, branch_point.branch)

# If that doesn't work, just find any remote that has the specified branch
for remote in repository.source_remotes():
if branch_point.branch in repository.branches_for(remote=remote, cached=True):
return 'refs/remotes/{}/{}'.format(remote, branch_point.branch)
Expand Down

0 comments on commit 95d5bbb

Please sign in to comment.