summaryrefslogtreecommitdiffstats
path: root/src/parse.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-04-26 18:04:02 -0400
committerDan Davison <dandavison7@gmail.com>2020-04-26 18:33:27 -0400
commit51511870925ac83ee04626cb284ea574eb09b30c (patch)
tree23c418da279b77e002a9aec49583bb8d06f0f78b /src/parse.rs
parentadfa0f98f8a5aff80bc8b0e4ae3b3e3a90717498 (diff)
Fix parsing file-path-containing-spaces from "rename" line
Diffstat (limited to 'src/parse.rs')
-rw-r--r--src/parse.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/parse.rs b/src/parse.rs
index 890b4d66..0df306dd 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -26,12 +26,8 @@ pub fn get_file_extension_from_marker_line(line: &str) -> Option<&str> {
}
pub fn get_file_path_from_file_meta_line(line: &str, git_diff_name: bool) -> String {
- if line.starts_with("rename") {
- match line.split(' ').nth(2) {
- Some(path) => path,
- _ => "",
- }
- .to_string()
+ if line.starts_with("rename ") {
+ line.split(' ').skip(2).collect::<Vec<&str>>().join(" ")
} else {
match line.split(' ').nth(1) {
Some("/dev/null") => "/dev/null",