Display warning about local-only changes. Warns the user that they have changes not present on the remote.
(&self, local_only: &[String])
| 357 | /// |
| 358 | /// Warns the user that they have changes not present on the remote. |
| 359 | fn display_local_only_warning(&self, local_only: &[String]) { |
| 360 | print_blank(); |
| 361 | print_warning(&format!( |
| 362 | "You have {} not on the remote:", |
| 363 | format_count(local_only.len(), "local change") |
| 364 | )); |
| 365 | |
| 366 | // Show up to 5 local-only changes |
| 367 | for hash in local_only.iter().take(5) { |
| 368 | let hash_short = &hash[..12.min(hash.len())]; |
| 369 | println!(" {} {}...", warning("!"), hash_short); |
| 370 | } |
| 371 | |
| 372 | if local_only.len() > 5 { |
| 373 | println!(" ... and {} more", local_only.len() - 5); |
| 374 | } |
| 375 | |
| 376 | print_blank(); |
| 377 | print_hint("These changes exist locally but not on the remote."); |
| 378 | print_hint("Use 'atomic push' to upload them, or they will remain local-only."); |
| 379 | } |
| 380 | |
| 381 | /// Async implementation of the pull command. |
| 382 | /// |
no test coverage detected