From 465b835da6311b8e33ab48cdf5be364869fd069c Mon Sep 17 00:00:00 2001
From: Leonidas Spyropoulos <artafinde@archlinux.org>
Date: Mon, 6 Feb 2023 17:21:32 +0000
Subject: [PATCH] aurweb: set receive.fsckobjects to true

https://git-scm.com/docs/git-config#Documentation/git-config.txt-receivefsckObjects
Related: https://gitlab.archlinux.org/archlinux/aurweb/-/issues/426

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
---
 roles/aurweb/tasks/main.yml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/roles/aurweb/tasks/main.yml b/roles/aurweb/tasks/main.yml
index e71578a0f..4426422d5 100644
--- a/roles/aurweb/tasks/main.yml
+++ b/roles/aurweb/tasks/main.yml
@@ -307,6 +307,13 @@
   become_user: "{{ aurweb_user }}"
   when: git_config.stdout.find('!HEAD') == -1
 
+- name: Set git-receive-pack to explicitly check all received objects  # noqa command-instead-of-module no-changed-when
+  command: git config --local receive.fsckobjects true
+  args:
+    chdir: "{{ aurweb_git_dir }}"
+  become: true
+  become_user: "{{ aurweb_user }}"
+
 - name: Configure sshd
   template: src=aurweb_config.j2 dest={{ sshd_includes_dir }}/aurweb_config owner=root group=root mode=0600 validate='/usr/sbin/sshd -t -f %s'
   notify:
-- 
GitLab