diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-04-26 18:04:02 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-04-26 18:33:27 -0400 |
commit | 51511870925ac83ee04626cb284ea574eb09b30c (patch) | |
tree | 23c418da279b77e002a9aec49583bb8d06f0f78b /src/parse.rs | |
parent | adfa0f98f8a5aff80bc8b0e4ae3b3e3a90717498 (diff) |
Fix parsing file-path-containing-spaces from "rename" line
Diffstat (limited to 'src/parse.rs')
-rw-r--r-- | src/parse.rs | 8 |
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", |