Print the status in short (porcelain) format.
(&self, status: &RepositoryStatus)
| 563 | |
| 564 | /// Print the status in short (porcelain) format. |
| 565 | fn print_short_format(&self, status: &RepositoryStatus) -> CliResult<()> { |
| 566 | // Print added files and directories |
| 567 | for entry in status.added() { |
| 568 | let path_str = entry.path().display().to_string(); |
| 569 | let is_dir = entry.details().map(|d| d == "directory").unwrap_or(false); |
| 570 | if is_dir { |
| 571 | println!("AD {}", path_str); |
| 572 | } else { |
| 573 | println!("A {}", path_str); |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | // Print modified files |
| 578 | for entry in status.modified() { |
| 579 | let path_str = entry.path().display().to_string(); |
| 580 | println!("M {}", path_str); |
| 581 | } |
| 582 | |
| 583 | // Print deleted files and directories |
| 584 | for entry in status.deleted() { |
| 585 | let path_str = entry.path().display().to_string(); |
| 586 | let is_dir = entry.details().map(|d| d == "directory").unwrap_or(false); |
| 587 | if is_dir { |
| 588 | println!("DD {}", path_str); |
| 589 | } else { |
| 590 | println!("D {}", path_str); |
| 591 | } |
| 592 | } |
| 593 | |
| 594 | // Print type-changed files |
| 595 | for entry in status.type_changed() { |
| 596 | let path_str = entry.path().display().to_string(); |
| 597 | println!("T {}", path_str); |
| 598 | } |
| 599 | |
| 600 | // Print permission-changed files |
| 601 | for entry in status.permissions_changed() { |
| 602 | let path_str = entry.path().display().to_string(); |
| 603 | println!("P {}", path_str); |
| 604 | } |
| 605 | |
| 606 | // Print conflicted files |
| 607 | for entry in status.conflicted() { |
| 608 | let path_str = entry.path().display().to_string(); |
| 609 | println!("C {}", path_str); |
| 610 | } |
| 611 | |
| 612 | // Print untracked files |
| 613 | if !self.no_untracked { |
| 614 | for entry in status.untracked() { |
| 615 | let path_str = entry.path().display().to_string(); |
| 616 | println!("?? {}", path_str); |
| 617 | } |
| 618 | } |
| 619 | |
| 620 | Ok(()) |
| 621 | } |
| 622 |