From 4863b1200cb1b634955c0af3c4433106e8b8c875 Mon Sep 17 00:00:00 2001
From: Jeremy Stanley <fungi@yuggoth.org>
Date: Thu, 17 Mar 2022 14:27:22 +0000
Subject: [PATCH] Disable partial clone feature in Gitea

Gitea 1.16 added partial clone support, but the clone filters pip
tries to apply (--filter=blob:none) don't work well when combined
with older cgit clients and lead to errors like "Server does not
allow request for unadvertised object" or "protocol error: bad pack
header".

Explicitly disable this feature server-side for now, so that clients
will fall back to making full clones.

Change-Id: Ia86394d5176c28567bf67b60578aadde6629c775
Depends-On: https://review.opendev.org/834196
---
 playbooks/roles/gitea/templates/app.ini.j2 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/playbooks/roles/gitea/templates/app.ini.j2 b/playbooks/roles/gitea/templates/app.ini.j2
index 791359a844..f476ffc6b6 100644
--- a/playbooks/roles/gitea/templates/app.ini.j2
+++ b/playbooks/roles/gitea/templates/app.ini.j2
@@ -34,6 +34,10 @@ ROOT = /data/git/repositories
 DISABLED_REPO_UNITS = repo.issues,repo.pulls,repo.wiki,repo.projects
 DISABLE_STARS = true
 
+[git]
+; Implemented in 1.16 but breaks pip install when using older Git clients
+DISABLE_PARTIAL_CLONE = true
+
 [indexer]
 ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
 REPO_INDEXER_ENABLED = true