Repository navigation
fix(git): skip remotes with an empty url when choosing the primary remote - #4900
Conversation
…mote The primary_remote() fallback scanned remote.<name>.url keys itself and accepted a remote whose only url is empty, after which remote_url() returned None for the primary remote. Reuse all_remote_urls(), which already filters empty values. Refs #4899
|
The empty-URL regression is well covered. Could you keep
|
Share the non-empty remote URL predicate between primary_remote() and all_remote_urls() instead of collecting every remote to take the first, and keep propagating an all_config() read error from primary_remote().
|
Done in 60fa877. A new |
primary_remote()'s fallback scannedremote.<name>.urlkeys itself and accepted the first one even when its only value was empty. Withremote.blank.url = ""listed beforeorigin, it choseblank, andprimary_remote_url()then returnedNonebecauseremote_url()filters empty values. The fallback still stops at the first matching config entry and still propagates anall_config()read error, but it now usesremote_url_entry(), the non-empty URL predicate it shares withall_remote_urls(). The new testtest_primary_remote_skips_remote_with_empty_urlreturnedblankbefore the change and returnsoriginafter it.This is the smaller gap from #4899. The main question there, whether to read the first
urlof a multi-URL remote and migrateproject_identifier, still needs a maintainer decision, and this PR leaves it alone. The change is in a different hunk ofremotes.rsfrom #4666.Refs #4899 — automated triage