From df348310dc2ba0b01f7dd7277184c688a5d430fe Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Sat, 24 Aug 2019 23:17:12 +0900 Subject: Add workaround for some CIs https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian8/ruby-master/log/20190824T093005Z.fail.html.gz ``` branches: * trunk remotes/origin/trunk ``` and ``` fatal: Remote branch master not found in upstream origin ``` --- tool/lib/vcs.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tool/lib') diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 55c7a96437..63ed62b640 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -540,9 +540,17 @@ class VCS end def export(revision, url, dir, keep_temp = false) - puts "branches:"; system(COMMAND, "branch", "-a") # for debug ret = system(COMMAND, "clone", "-s", (@srcdir || '.').to_s, "-b", url, dir) ret + rescue => e + if "master" == url.to_str && e.message == "Command failed with exit 128: git" + warn "retry trunk instead of master", uplevel: 0 + STDERR.puts "existing branches:" + system(COMMAND, "branch", "-a", 1 => 2) + url = Branch.new("trunk") + retry + end + raise end def after_export(dir) -- cgit v1.2.3