ruby-changes:57239
From: Kazuhiro <ko1@a...>
Date: Sat, 24 Aug 2019 23:20:08 +0900 (JST)
Subject: [ruby-changes:57239] Kazuhiro NISHIYAMA: df348310dc (master): Add workaround for some CIs
https://git.ruby-lang.org/ruby.git/commit/?id=df348310dc From df348310dc2ba0b01f7dd7277184c688a5d430fe Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> 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 ``` diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 55c7a96..63ed62b 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -540,9 +540,17 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L540 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 v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/