diff --git a/swh/vault/cookers/git_bare.py b/swh/vault/cookers/git_bare.py --- a/swh/vault/cookers/git_bare.py +++ b/swh/vault/cookers/git_bare.py @@ -19,6 +19,7 @@ import datetime import enum +import glob import logging import os.path import re @@ -152,6 +153,10 @@ subprocess.run(["git", "-C", self.gitdir, "init", "--bare"], check=True) self.create_object_dirs() + # Remove example hooks; they take ~40KB and we don't use them + for filename in glob.glob(os.path.join(self.gitdir, "hooks", "*.sample")): + os.unlink(filename) + def create_object_dirs(self) -> None: # Create all possible dirs ahead of time, so we don't have to check for # existence every time.