Show More
@@ -542,12 +542,17 b" impl DisplayStatusPaths<'_> {" | |||||
542 | // TODO: get the stdout lock once for the whole loop |
|
542 | // TODO: get the stdout lock once for the whole loop | |
543 | // instead of in each write |
|
543 | // instead of in each write | |
544 | for StatusPath { path, copy_source } in paths { |
|
544 | for StatusPath { path, copy_source } in paths { | |
545 | let relative; |
|
545 | let relative_path; | |
546 | let path = if let Some(relativize) = &self.relativize { |
|
546 | let relative_source; | |
547 | relative = relativize.relativize(&path); |
|
547 | let (path, copy_source) = if let Some(relativize) = | |
548 |
& |
|
548 | &self.relativize | |
|
549 | { | |||
|
550 | relative_path = relativize.relativize(&path); | |||
|
551 | relative_source = | |||
|
552 | copy_source.as_ref().map(|s| relativize.relativize(s)); | |||
|
553 | (&*relative_path, relative_source.as_deref()) | |||
549 | } else { |
|
554 | } else { | |
550 | path.as_bytes() |
|
555 | (path.as_bytes(), copy_source.as_ref().map(|s| s.as_bytes())) | |
551 | }; |
|
556 | }; | |
552 | // TODO: Add a way to use `write_bytes!` instead of `format_bytes!` |
|
557 | // TODO: Add a way to use `write_bytes!` instead of `format_bytes!` | |
553 | // in order to stream to stdout instead of allocating an |
|
558 | // in order to stream to stdout instead of allocating an | |
@@ -560,7 +565,7 b" impl DisplayStatusPaths<'_> {" | |||||
560 | if let Some(source) = copy_source.filter(|_| !self.no_status) { |
|
565 | if let Some(source) = copy_source.filter(|_| !self.no_status) { | |
561 | let label = "status.copied"; |
|
566 | let label = "status.copied"; | |
562 | self.ui.write_stdout_labelled( |
|
567 | self.ui.write_stdout_labelled( | |
563 |
&format_bytes!(b" {}\n", source |
|
568 | &format_bytes!(b" {}\n", source), | |
564 | label, |
|
569 | label, | |
565 | )? |
|
570 | )? | |
566 | } |
|
571 | } |
General Comments 0
You need to be logged in to leave comments.
Login now