@@ -157,12 +157,16 @@ def rebase_commits(impl)
157
157
end
158
158
end
159
159
160
+ def new_commits? ( impl )
161
+ Dir . chdir ( SOURCE_REPO ) do
162
+ diff = `git diff master #{ impl . rebased_branch } `
163
+ !diff . empty?
164
+ end
165
+ end
166
+
160
167
def test_new_specs
161
168
require "yaml"
162
169
Dir . chdir ( SOURCE_REPO ) do
163
- diff = `git diff master`
164
- abort "#{ BRIGHT_YELLOW } No new commits, aborting#{ RESET } " if diff . empty?
165
-
166
170
workflow = YAML . load_file ( ".github/workflows/ci.yml" )
167
171
job_name = MSPEC ? "test" : "specs"
168
172
versions = workflow . dig ( "jobs" , job_name , "strategy" , "matrix" , "ruby" )
@@ -195,8 +199,8 @@ def verify_commits(impl)
195
199
def fast_forward_master ( impl )
196
200
Dir . chdir ( SOURCE_REPO ) do
197
201
sh "git" , "checkout" , "master"
198
- sh "git" , "merge" , "--ff-only" , " #{ impl . name } -rebased"
199
- sh "git" , "branch" , "--delete" , " #{ impl . name } -rebased"
202
+ sh "git" , "merge" , "--ff-only" , impl . rebased_branch
203
+ sh "git" , "branch" , "--delete" , impl . rebased_branch
200
204
end
201
205
end
202
206
@@ -215,10 +219,15 @@ def main(impls)
215
219
update_repo ( impl )
216
220
filter_commits ( impl )
217
221
rebase_commits ( impl )
218
- test_new_specs
219
- verify_commits ( impl )
220
- fast_forward_master ( impl )
221
- check_ci
222
+ if new_commits? ( impl )
223
+ test_new_specs
224
+ verify_commits ( impl )
225
+ fast_forward_master ( impl )
226
+ check_ci
227
+ else
228
+ STDERR . puts "#{ BRIGHT_YELLOW } No new commits#{ RESET } "
229
+ fast_forward_master ( impl )
230
+ end
222
231
end
223
232
end
224
233
0 commit comments