fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

gitindex: update remote.origin.url if clone already exists (#776)

This is so that when authentication details change we correctly update
the CloneURL for repositories managed by our mirror commands.

+4 -1
+4 -1
gitindex/clone.go
··· 18 18 "bytes" 19 19 "fmt" 20 20 "log" 21 + "maps" 21 22 "os" 22 23 "os/exec" 23 24 "path/filepath" ··· 60 61 61 62 repoDest := filepath.Join(parent, filepath.Base(name)+".git") 62 63 if _, err := os.Lstat(repoDest); err == nil { 63 - // Repository exists, ensure settings are in sync 64 + // Repository exists, ensure settings are in sync including the clone URL 65 + settings := maps.Clone(settings) 66 + settings["remote.origin.url"] = cloneURL 64 67 if err := updateZoektGitConfig(repoDest, settings); err != nil { 65 68 return "", fmt.Errorf("failed to update repository settings: %w", err) 66 69 }