summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-04-09 18:23:49 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-04-09 18:23:49 +0900
commit55a5a4bc03de1027dca359d50e23ee57c2224353 (patch)
tree20285dceeffde1d3a89b9b20f1b78cd51c75b782
parent7a26021d1d288912b123447847bc389acac5290e (diff)
Fixed to initialize ruby-core repository when it has no master branch
-rw-r--r--tool/sync_default_gems.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 63cf0a1a73..d034e723a4 100644
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -440,14 +440,16 @@ def update_default_gems(gem)
Dir.chdir("../../#{author}/#{repository}") do
unless `git remote`.match(/ruby\-core/)
`git remote add ruby-core git@github.com:ruby/ruby.git`
- `git fetch ruby-core --no-tags`
+ end
+ `git fetch ruby-core master --no-tags`
+ unless `git branch`.match(/ruby\-core/)
`git co ruby-core/master`
`git branch ruby-core`
end
- `git fetch ruby-core master --no-tags`
`git co ruby-core`
`git rebase ruby-core/master`
`git co master`
+ `git fetch origin master`
`git rebase origin/master`
end
end