@@ -36,6 +36,9 @@ def check_git_repo(dirpath):
36
36
with cd (dirpath ):
37
37
return subprocess .run (['git' , 'diff-index' , '--quiet' , 'HEAD' , '--' ]).returncode == 0
38
38
39
+ def check_commit_is_available (hash ):
40
+ subprocess .check_output (['git' , 'branch' , '-r' , '--contains' , hash ])
41
+
39
42
def get_repo_and_commit_info (dirpath ):
40
43
with cd (dirpath ):
41
44
remote = subprocess .check_output (['git' , 'config' , '--get' , 'remote.origin.url' ]).decode ().strip ()
@@ -171,6 +174,8 @@ def main():
171
174
remote , hash = get_repo_and_commit_info (git_repos [0 ])
172
175
if test_build or pre_build :
173
176
hash = push_bumped_release (git_repos [0 ], target , test_build , pre_build )
177
+ else :
178
+ check_commit_is_available (hash )
174
179
url = koji_url (remote , hash )
175
180
command = (
176
181
['koji' , 'build' ]
@@ -187,6 +192,8 @@ def main():
187
192
remote , hash = get_repo_and_commit_info (d )
188
193
if test_build or pre_build :
189
194
hash = push_bumped_release (d , target , test_build , pre_build )
195
+ else :
196
+ check_commit_is_available (hash )
190
197
urls .append (koji_url (remote , hash ))
191
198
command = ['koji' , 'chain-build' , target ] + (' : ' .join (urls )).split (' ' ) + (['--nowait' ] if is_nowait else [])
192
199
print (' ' .join (command ), flush = True )
0 commit comments