aboutsummaryrefslogtreecommitdiffsponsor
path: root/internal/service/git.go
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2024-10-23 10:52:46 -0500
committerSlack Coder <slackcoder@server.ky>2024-10-23 10:52:46 -0500
commite7dd47e8b683a51851883bf2918086963676d7cd (patch)
tree827067192a90b0ff4acae0263c99bfa80701b46b /internal/service/git.go
parent58b725f923ce0f815b45633015306523dfc0f9a8 (diff)
downloadmirror-master.tar.xz
Avoid hosting assets on Git mirrorHEADv0.0.2master
Diffstat (limited to 'internal/service/git.go')
-rw-r--r--internal/service/git.go9
1 files changed, 9 insertions, 0 deletions
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)