fix: separate the paths of a -z entry with a NUL, not an arrow
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user