From d1856bea26c9af823a3a0e977e9ec544154012c4 Mon Sep 17 00:00:00 2001 From: linsui <2873532-linsui@users.noreply.gitlab.com> Date: Wed, 10 Jul 2024 14:57:54 +0800 Subject: [PATCH] Prune origin before fetch --- fdroidserver/common.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 252ecdfb..628067ae 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1390,12 +1390,9 @@ class vcs_git(vcs): raise VCSException(_("Git clean failed"), p.output) if not self.refreshed: # Get latest commits and tags from remote - p = self.git(['fetch', 'origin'], cwd=self.local) + p = self.git(['fetch', '--prune', '--prune-tags', '--force', 'origin'], cwd=self.local) if p.returncode != 0: raise VCSException(_("Git fetch failed"), p.output) - p = self.git(['remote', 'prune', 'origin'], output=False, cwd=self.local) - if p.returncode != 0: - raise VCSException(_("Git prune failed"), p.output) p = self.git(['fetch', '--prune', '--tags', '--force', 'origin'], output=False, cwd=self.local) if p.returncode != 0: raise VCSException(_("Git fetch failed"), p.output)