From 23b7fde0eac9aa42fb5f4a2814ee85ee71fe0cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Tue, 8 Sep 2026 14:40:21 +0000 Subject: [PATCH] fix: separate the paths of a -z entry with a NUL, not an arrow --- src/commands/link/check.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/commands/link/check.rs b/src/commands/link/check.rs index b13f869..868b7d9 100644 --- a/src/commands/link/check.rs +++ b/src/commands/link/check.rs @@ -53,10 +53,19 @@ pub fn check( fn print_porcelain(exposed: &[Exposed], null: bool) { let end = if null { '\0' } else { '\n' }; + // a filename can hold an arrow but not a NUL, so -z separates the two paths + // with one the way `git status -z` does for a rename. the two character code + // stays where it is: it cannot be mistaken for part of a path + let between = if null { "\0" } else { " -> " }; for item in exposed { match &item.dest { - Some(dest) => text!("{} {} -> {}{end}", item.code(), item.name, dest.display()), + Some(dest) => text!( + "{} {}{between}{}{end}", + item.code(), + item.name, + dest.display() + ), None => text!("{} {}{end}", item.code(), item.name), } }