From e7dd47e8b683a51851883bf2918086963676d7cd Mon Sep 17 00:00:00 2001 From: Slack Coder Date: Wed, 23 Oct 2024 10:52:46 -0500 Subject: Avoid hosting assets on Git mirror --- internal/service/git.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/service/git.go b/internal/service/git.go index b61e332..d56c96b 100644 --- a/internal/service/git.go +++ b/internal/service/git.go @@ -106,6 +106,15 @@ func MirrorGit(dst *internal.URL, src *internal.URL, description string) error { err = mapExecError(err) return fmt.Errorf("cloning: %s", err) } + + // Git mirrors are not good places for mirrored assets. + cmd = exec.Command("git", "config", "set", "cgit.snapshots", "none") + cmd.Dir = dst.Path + err = cmd.Run() + if err != nil { + err = mapExecError(err) + return fmt.Errorf("disabling cgit snapshots: %s", err) + } } err := setDescription(dst.Path, description) -- cgit v1.2.3