summaryrefslogtreecommitdiff
path: root/tool/lib/vcs.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/lib/vcs.rb')
-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)