From 24132b737efb797d86300d0f69ba709ccf33010e Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Wed, 24 Jun 2026 15:35:57 +0200 Subject: [PATCH] fix: remove force flag from push_to_gitea heads refspec to avoid overwriting Gitea commits --- svn_mirror/gitea.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/svn_mirror/gitea.py b/svn_mirror/gitea.py index aa99ed2..b13b494 100644 --- a/svn_mirror/gitea.py +++ b/svn_mirror/gitea.py @@ -82,10 +82,13 @@ def push_to_gitea(mirror: Mirror) -> bool: # Gitea fetches from canonical — this transfers objects + refs, # and DOES NOT trigger Gitea's pre-receive hook. + # NOTE: no `+` prefix on heads — only fast-forward allowed. + # If Gitea is ahead (user pushed there), this fetch is a no-op + # and `fetch_from_gitea` brings those commits into canonical next. _git( "--git-dir", str(gitea_path), "fetch", "--prune", canonical, - "+refs/heads/*:refs/heads/*", + "refs/heads/*:refs/heads/*", "+refs/tags/*:refs/tags/*", timeout=300, )