If the mirrored repo has a remote, try mirroring the changes pulled to it

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2020-05-03 21:21:28 +02:00
parent a25e830b8d
commit ebd553f405

View file

@ -107,6 +107,16 @@ class MirrorFromPagure(object):
cmd = ["git", "-c", "transfer.fsckObjects=1", "fetch"]
run_command(cmd, cwd=dest_folder)
cmd = ["git", "remote"]
output = run_command(cmd, cwd=dest_folder).decode("utf-8").strip()
if output:
for remote in output.split("\n"):
_log.info(" Running git push --mirror against %s", remote)
cmd = ["git", "push", "--mirror", remote]
run_command(cmd, cwd=dest_folder)
else:
_log.info(" No remotes found")
except Exception:
_log.exception("Something happened while calling git")
if cnt >= 3: