From 974b59e4a5813bd75e0a173d8f7c2dbb3467d3e7 Mon Sep 17 00:00:00 2001 From: Roxy Light Date: Sat, 2 Nov 2024 19:00:06 -0700 Subject: [PATCH] Fix Git 2.46 logic bug in ListRemotes --- config.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config.go b/config.go index b2412cf..6dbfd08 100644 --- a/config.go +++ b/config.go @@ -213,9 +213,13 @@ func (cfg *Config) ListRemotes() map[string]*Remote { } for _, remote := range remotes { if improvedHandling { - remote.FetchURL = remote.Name - } - if !pushURLsSet[remote.Name] { + if remote.FetchURL == "" { + remote.FetchURL = remote.Name + } + if remote.PushURL == "" { + remote.PushURL = remote.FetchURL + } + } else if !pushURLsSet[remote.Name] { remote.PushURL = remote.FetchURL } }