On Tue, Oct 20, 2020 at 10:58:51AM +0800, Li Yuanchao wrote:
sometimes the testcase needs a specific version software, add upstream_tag can help find the specific version.
Signed-off-by: Li Yuanchao lyc163mail@163.com
sbin/auto_submit | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/sbin/auto_submit b/sbin/auto_submit index 1f55701..88ec560 100755 --- a/sbin/auto_submit +++ b/sbin/auto_submit @@ -28,12 +28,25 @@ class AutoSubmit return pkgbuild_repo end
- def if_tagged(tag_list, commit_id)
if_tagged这个名字不太合适,函数名称本身体现该函数是做什么 Thanks sunyukui
tag_list.each_line do |line|
if line.include?(commit_id)
tag = line.split
return tag[1].delete_prefix('refs/tags/')
end
end
return nil
end
def submit(newrefs_info, submit_argv)
tag_list = %x(git -C /srv/git/#{newrefs_info['git_repo']}.git show-ref --tags) newrefs_info['new_refs']['heads'].each do |branch, commit_id| real_argvs = Array.new(submit_argv) commit_date = `git -C /srv/git/#{newrefs_info['git_repo']}.git log --format=%ct -1 #{commit_id}` real_argvs.push("upstream_branch=#{branch.delete_prefix('refs/heads/')}") real_argvs.push("upstream_commit=#{commit_id}")
tag = if_tagged(tag_list, commit_id)
real_argvs.push("upstream_tag=#{tag}") if tag real_argvs.push("commit_date=#{commit_date}") system(real_argvs.join(' '))
-- 2.23.0