feat: Use receive.hideRefs (#10015)

In forgejo/forgejo!2834 and forgejo/forgejo!5307 it was made so it's no longer possible to modify and delete internal reference, not having this restriction lead to broken pull requests when people used something like `git push --mirror`. However it now still leads to problem with that command as the git client tries to delete such references. We can solve this by using git's `receive.hideRefs` to make this ref read-only and avoid advertising it when someone does `git push --mirror`.

Resolves forgejo/forgejo#9942

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10015
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
Gusted
2025-11-10 14:36:15 +01:00
committed by Gusted
parent 5c9a909c03
commit 5b77ddb050
10 changed files with 178 additions and 120 deletions
+1
View File
@@ -108,6 +108,7 @@ forgejo.org/modules/git
AddChangesWithArgs
CommitChanges
CommitChangesWithArgs
IsErrMoreThanOne
SetUpdateHook
openRepositoryWithDefaultContext
ToEntryMode