From da3640fc376bdf08f70cedbd05cbfbc9abafd194 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 23 2018 09:43:21 +0000 Subject: Support force push for project not on repospanner Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index fcbba20..87d2c8b 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -967,7 +967,7 @@ class TemporaryClone(object): """ Exit the context manager, removing the temorary clone. """ shutil.rmtree(self.repopath) - def push(self, username, sbranch, tbranch=None, **extra): + def push(self, username, sbranch, tbranch=None, force=False, **extra): """ Push the repo back to its origin. Args: @@ -1026,6 +1026,8 @@ class TemporaryClone(object): } else: command = ["git", "push", "origin"] + if force: + command.append("--force") environ = {} try: