Skip pushing of empty repos https://github.com/MarcelSimon/MigrateGitlabToGogs/issues/3
This commit is contained in:
parent
7410d39149
commit
dfc5cc189f
@ -123,7 +123,11 @@ for i in range(len(filtered_projects)):
|
||||
# Git pull and push
|
||||
subprocess.check_call(['git','clone','--bare',src_url])
|
||||
os.chdir(src_url.split('/')[-1])
|
||||
subprocess.check_call(['git','push','--mirror',dst_url])
|
||||
branches=subprocess.check_output(['git','branch','-a'])
|
||||
if len(branches) == 0:
|
||||
print('\n\nThis repository is empty - skipping push')
|
||||
else:
|
||||
subprocess.check_call(['git','push','--mirror',dst_url])
|
||||
os.chdir('..')
|
||||
subprocess.check_call(['rm','-rf',src_url.split('/')[-1]])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user