| 1 | #!/bin/bash |
| 2 | |
| 3 | # Assumes all commits have been synchronized to https://github.com/ruby/spec |
| 4 | # See spec/mspec/tool/sync/sync-rubyspec.rb |
| 5 | |
| 6 | function sync { |
| 7 | dir="$1" |
| 8 | repo="$2" |
| 9 | short_repo_name="ruby/$(basename "$repo" .git)" |
| 10 | |
| 11 | rm -rf "$dir" |
| 12 | git clone --depth 1 "$repo" "$dir" |
| 13 | commit=$(git -C "$dir" log -n 1 --format='%h') |
| 14 | rm -rf "$dir/.git" |
| 15 | |
| 16 | # Remove CI files to avoid confusion |
| 17 | rm -f "$dir/appveyor.yml" |
| 18 | rm -f "$dir/.travis.yml" |
| 19 | rm -rf "$dir/.github" |
| 20 | |
| 21 | git add "$dir" |
| 22 | git commit -m "Update to ${short_repo_name}@${commit}" |
| 23 | } |
| 24 | |
| 25 | sync spec/mspec https://github.com/ruby/mspec.git |
| 26 | sync spec/ruby https://github.com/ruby/spec.git |