3

通常我们在 jenkins 中使用gerrit 触发器插件来下载 gerrit 变更集。

但在某些情况下,我们希望直接下载特定的变更集。

例如openstack 更改 #503032

git pull git://git.openstack.org/openstack/tripleo-quickstart-extras refs/changes/32/503032/2

并在 git repo 中设置Refspecrefs/changes/32/503032/2

在此处输入图像描述

并启用Honor refspec on initial clone额外的行为,如

在此处输入图像描述

但我在控制台日志中收到错误

从 git://git.openstack.org/openstack/tripleo-quickstart-extras 获取上游更改
 > git fetch --tags --progress git://git.openstack.org/openstack/tripleo-quickstart-extras refs/changes/32/503032/2 --depth=1
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
 > git rev-parse origin/master^{commit} # timeout=10
错误:找不到要构建的任何修订。验证此作业的存储库和分支配置。

任何建议,我们都不想在 shell 构建步骤中使用额外的命令。

4

1 回答 1

9

将“Branch”设置为FETCH_HEAD,指定的 refspec 将被检出。

FETCH_HEAD是一个临时 ref,指向最新获取的 refspec,例如。分支,提交。有关更多信息,请参阅此问题:Git 中的 FETCH_HEAD 是什么意思?.

于 2017-09-22T06:32:44.777 回答