1
0
Fork 0

only push if we deleted something

This commit is contained in:
Christian Kühnel 2020-05-08 15:27:09 +02:00
parent e6437d35f0
commit d48ff97d0d

View file

@ -46,8 +46,8 @@ def delete_old_branches(repo_path: str, max_age: datetime.datetime, branch_patte
del_count += 1
print('Deleted {} references.'.format(del_count))
if not dry_run:
print('Pushing to remote...')
if not dry_run and del_count > 0:
print('Pushing deleted branches to remote...')
repo.remotes[remote_name].push()
print('Done.')