@@ -9,6 +9,7 @@ import (
99
1010 // writeClone writes /<name>.git, a bare copy of the project's repo that any static server can serve
1111 // to `git clone` over git's dumb HTTP protocol. A local clone hard-links its objects, so it costs little disk.
12+// The clone drops its origin, so its public config does not show the mirror's path on this machine.
1213 func writeClone(out, name, dir string) error {
1314 dest := filepath.Join(out, name+".git")
1415 if err := os.RemoveAll(dest); err != nil {
@@ -17,5 +18,8 @@ func writeClone(out, name, dir string) error {
1718 if out, err := exec.Command("git", "clone", "--bare", "--quiet", dir, dest).CombinedOutput(); err != nil {
1819 return fmt.Errorf("git clone: %w: %s", err, out)
1920 }
21+ if err := exec.Command("git", "--git-dir", dest, "remote", "remove", "origin").Run(); err != nil {
22+ return err
23+ }
2024 return exec.Command("git", "--git-dir", dest, "update-server-info").Run()
2125 }