Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/cmds/git/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,13 @@ fn run_status(args: &[String], verbose: u8, global_args: &[String]) -> Result<i3
// Apply minimal filtering: strip ANSI, remove hints, empty lines
let filtered = filter_status_with_args(&result.stdout);
let filtered = never_worse(&result.stdout, &filtered).to_string();
print!("{}", filtered);
// Preserve a trailing newline like native git --short/--porcelain so
// shell pipelines and `read` loops do not drop the last entry (#3303).
if filtered.is_empty() || filtered.ends_with('\n') {
print!("{}", filtered);
} else {
println!("{}", filtered);
}

timer.track(
&format!("git status {}", args.join(" ")),
Expand Down