Skip to content

Fix: Default branch of Mono isn't master

路志远请求将fix-mono-client-default-branch合并到main-jh

What does this MR do and why?

What

修复 Gerrit Repo 的小 bug。

将 Class MetaProject 的实例属性 revisionExprmaster 改为 main-jh

Why

  • Class MetaProject 是 Mono 仓库自己的类。在使用 mono selfupdate 更新自己时,MetaProject 会派上用场。
  • revisionExpr 表示 Mono 仓库的默认分支。

Mono 的默认分支是 main-jh,Gerrit Repo 的默认分支是 main,所以无论是 Mono 还是 Repo,都不应该将 master 写在代码中。

当执行 mono selfupdate 时,会取 Mono 当前分支的 Track 分支作为 git fetch 的对象,如果没有 Track 分支,会取上述 revisionExpr 作为默认参数。现在后者会报错,因为 Mono 没有 master 分支。复现步骤:How to set up and validate locally

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. 安装步骤 完成 Mono client 的安装
  2. mono 创建一个本地分支
    $ cd .repo/repo/ && git checkout -b local-branch-without-track
  3. 执行 mono selfupdate,期待看到报错 Couldn't find remote ref refs/heads/master
    $ mono selfupdate
    fatal: Couldn't find remote ref refs/heads/master
    repo: sleeping 4.0 seconds before retrying
    fatal: Couldn't find remote ref refs/heads/master
    error: can't update mono

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

路志远 编辑于

合并请求报告