Skip to content

Remote branch is no longer specified when "git pull"

路志远请求将fix-mono-sync-for-manifest合并到main-jh

What does this MR do and why?

执行 mono sync 时,会自动执行 git pull 操作,当前 MR 用来优化此 git pull 命令:

Before:

git pull origin --quiet {branch.name}

After:

git pull origin --quiet

这解决了当分支名和 remote 分支名不匹配时发生的错误。例如:

什么情况下会出现和 remote 分支名不一致?

仅在 manifest 仓库中才会出现。

之前我们已经做了改动:新创建的分支不再自动追踪主分支,于是本地分支与 remote 分支没有不一致的情况了(除非用户自己强制改)。

manifest 仓库是个例外:在通过 mono init 初始化本地环境时,下载 manifest 仓库并创建本地分支 default 追踪 main 分支,即本地分支不等于 remote 分支。

此改动会有其他负面影响吗?

应该没有。

git pull 就应该去拉取 remote 分支,之前的写法不合适。

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

略。

路志远 编辑于

合并请求报告