summaryrefslogtreecommitdiff
path: root/tool/lib
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-08-24 23:17:12 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-08-24 23:17:12 +0900
commitdf348310dc2ba0b01f7dd7277184c688a5d430fe (patch)
tree15cf3ee41a3174d1f2d97707a9a7cd3382f55a60 /tool/lib
parent5d5502dc852cc7588c75c519f5c881ead577e827 (diff)
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 ```
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/vcs.rb10
1 files changed, 9 insertions, 1 deletions
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)