Skip to main content

parse_remote_v

Function parse_remote_v 

Source
pub fn parse_remote_v(out: &str) -> Vec<RemoteEntry>
Expand description

Parse the output of git remote -v.

The format is one <name>\t<url> (fetch) line and one <name>\t<url> (push) line per remote, fetch first. Remotes are returned in first-appearance order, which is the alphabetical order git itself emits.

Unparseable lines are skipped, not fatal. A remote whose name or URL contains something this parser does not expect must not take the whole list down with it — the user would see an empty buffer with no way to reach the remotes that are fine. A line missing its tab, or carrying neither (fetch) nor (push), is dropped silently here; the caller renders whatever survived.