在gerrit网页中成功删除branch/tag,但在gitlab后端未删除

delete branch/tag in gerrit web page successfully but not deleted in gitlab backend

哪些步骤会重现问题?

Select一个分支,在gerrit网页中删除。

预期输出是多少?

在gerrit网页删除分支成功,同时在gitlab中也删除了分支

你看到了什么?

gitlab中没有删除

附加信息:

  1. 正常的代码修改可以成功复制到gitlab。
  2. replication_log 文件中没有错误消息。
  3. 删除标签也存在这个问题

当我在gerrit网页中添加一个分支时,复制日志是:

[2018-05-28 19:29:54,076] [] scheduling replication gerrit_test_only:refs/heads/release/v0.0.1 => git@192.168.0.224:fund-wuhan/gerrit_test_only.git
[2018-05-28 19:29:54,077] [] scheduled gerrit_test_only:refs/heads/release/v0.0.1 => [96bab7ae] push git@192.168.0.224:fund-wuhan/gerrit_test_only.git to run after 15s
[2018-05-28 19:30:09,077] [96bab7ae] Replication to git@192.168.0.224:fund-wuhan/gerrit_test_only.git started...
[2018-05-28 19:30:09,079] [96bab7ae] Push to git@192.168.0.224:fund-wuhan/gerrit_test_only.git references: [RemoteRefUpdate[remoteName=refs/heads/release/v0.0.1, NOT_ATTEMPTED, (null)...ecf1c112a9596a6d4a9054fc26dd2158ce8a9762, srcRef=refs/heads/release/v0.0.1, forceUpdate, message=null]]
[2018-05-28 19:30:09,697] [96bab7ae] Replication to git@192.168.0.224:fund-wuhan/gerrit_test_only.git completed in 610ms, 15000ms delay, 0 retries

当我在gerrit网页中删除一个分支时,复制日志是:

[2018-05-28 19:30:31,370] [] scheduling replication gerrit_test_only:refs/heads/release/v0.0.1 => git@192.168.0.224:fund-wuhan/gerrit_test_only.git
[2018-05-28 19:30:31,370] [] scheduled gerrit_test_only:refs/heads/release/v0.0.1 => [1679e7ee] push git@192.168.0.224:fund-wuhan/gerrit_test_only.git to run after 15s
[2018-05-28 19:30:46,370] [1679e7ee] Replication to git@192.168.0.224:fund-wuhan/gerrit_test_only.git started...
[2018-05-28 19:30:46,373] [1679e7ee] Replication to git@192.168.0.224:fund-wuhan/gerrit_test_only.git completed in 2ms, 15000ms delay, 0 retries

可以发现没有

"Push to git@192.168.0.224:fund-wuhan/gerrit_test_only.git references: [RemoteRefUpdate[remoteName=refs/heads/release/v0.0.1, NOT_ATTEMPTED, (null)...ecf1c112a9596a6d4a9054fc26dd2158ce8a9762, srcRef=refs/heads/release/v0.0.1, forceUpdate, message=null]]"

当我删除一个分支时。我想就是这个原因。

remote.NAME.mirror 如果为真,复制将删除本地不存在或对复制不可见的远程分支(例如通过 authGroup 选项拒绝读取访问)。

默认为false,不删除远程分支。

将"mirror = true"添加到replication.config就可以了。