| 1132 | |
| 1133 | #[test] |
| 1134 | fn test_add_default_unmarks_existing() { |
| 1135 | let mut config = RemoteConfig::new(); |
| 1136 | config |
| 1137 | .add( |
| 1138 | "origin", |
| 1139 | RemoteEntry::new_default("https://origin.com/repo"), |
| 1140 | ) |
| 1141 | .unwrap(); |
| 1142 | config |
| 1143 | .add( |
| 1144 | "upstream", |
| 1145 | RemoteEntry::new_default("https://upstream.com/repo"), |
| 1146 | ) |
| 1147 | .unwrap(); |
| 1148 | |
| 1149 | // Adding a new default should unmark the old one |
| 1150 | assert!(!config.get("origin").unwrap().default); |
| 1151 | assert!(config.get("upstream").unwrap().default); |
| 1152 | } |
| 1153 | } |