From 31bf43dfc8568e776d0c8c7466d0d220e3a1469c Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Thu, 16 Jul 2026 15:46:48 +0200 Subject: [PATCH] fix: remove --prune from push_to_gitea to avoid deleting user branches --- svn_mirror/gitea.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/svn_mirror/gitea.py b/svn_mirror/gitea.py index 172e6cc..1ea5ba7 100644 --- a/svn_mirror/gitea.py +++ b/svn_mirror/gitea.py @@ -84,7 +84,8 @@ def push_to_gitea(mirror: Mirror) -> bool: # and DOES NOT trigger Gitea's pre-receive hook. # Only fast-forward updates allowed (no `+` prefix on heads). # If Gitea is ahead (user pushed there), this is safely skipped. - cmd = ["git", "--git-dir", str(gitea_path), "fetch", "--prune", + # NOTE: no `--prune` — would delete Gitea-only branches (user pushes) + cmd = ["git", "--git-dir", str(gitea_path), "fetch", canonical, "refs/heads/*:refs/heads/*", "+refs/tags/*:refs/tags/*"] try: