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), } }