Skip to content

Commit 974b59e

Browse files
committed
Fix Git 2.46 logic bug in ListRemotes
1 parent c3d8f2c commit 974b59e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

config.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,13 @@ func (cfg *Config) ListRemotes() map[string]*Remote {
213213
}
214214
for _, remote := range remotes {
215215
if improvedHandling {
216-
remote.FetchURL = remote.Name
217-
}
218-
if !pushURLsSet[remote.Name] {
216+
if remote.FetchURL == "" {
217+
remote.FetchURL = remote.Name
218+
}
219+
if remote.PushURL == "" {
220+
remote.PushURL = remote.FetchURL
221+
}
222+
} else if !pushURLsSet[remote.Name] {
219223
remote.PushURL = remote.FetchURL
220224
}
221225
}

0 commit comments

Comments
 (0)