Print the status in short (porcelain) format.
(&self, status: &RepositoryStatus)
| 385 | |
| 386 | /// Print the status in short (porcelain) format. |
| 387 | fn print_short_format(&self, status: &RepositoryStatus) -> CliResult<()> { |
| 388 | // Print added files and directories |
| 389 | for entry in status.added() { |
| 390 | let path_str = entry.path().display().to_string(); |
| 391 | let is_dir = entry.details().map(|d| d == "directory").unwrap_or(false); |
| 392 | if is_dir { |
| 393 | println!("AD {}", path_str); |
| 394 | } else { |
| 395 | println!("A {}", path_str); |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | // Print modified files |
| 400 | for entry in status.modified() { |
| 401 | let path_str = entry.path().display().to_string(); |
| 402 | println!("M {}", path_str); |
| 403 | } |
| 404 | |
| 405 | // Print deleted files and directories |
| 406 | for entry in status.deleted() { |
| 407 | let path_str = entry.path().display().to_string(); |
| 408 | let is_dir = entry.details().map(|d| d == "directory").unwrap_or(false); |
| 409 | if is_dir { |
| 410 | println!("DD {}", path_str); |
| 411 | } else { |
| 412 | println!("D {}", path_str); |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | // Print conflicted files |
| 417 | for entry in status.conflicted() { |
| 418 | let path_str = entry.path().display().to_string(); |
| 419 | println!("C {}", path_str); |
| 420 | } |
| 421 | |
| 422 | // Print untracked files |
| 423 | if !self.no_untracked { |
| 424 | for entry in status.untracked() { |
| 425 | let path_str = entry.path().display().to_string(); |
| 426 | println!("?? {}", path_str); |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | Ok(()) |
| 431 | } |
| 432 | |
| 433 | /// Print a stable, versioned status document for editor integrations. |
| 434 | fn print_json_format( |