diff options
Diffstat (limited to 'src/parse.rs')
-rw-r--r-- | src/parse.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parse.rs b/src/parse.rs index 05b0ceb5..7e39c772 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -22,6 +22,7 @@ pub fn get_file_extension_from_marker_line(line: &str) -> Option<&str> { #[derive(Debug, PartialEq)] pub enum FileEvent { Change, + Copy, Rename, NoEvent, } @@ -47,6 +48,12 @@ pub fn parse_file_meta_line(line: &str, git_diff_name: bool) -> (String, FileEve line if line.starts_with("rename to ") => { (line[10..].to_string(), FileEvent::Rename) // "rename to ".len() } + line if line.starts_with("copy from ") => { + (line[10..].to_string(), FileEvent::Copy) // "copy from ".len() + } + line if line.starts_with("copy to ") => { + (line[8..].to_string(), FileEvent::Copy) // "copy to ".len() + } _ => ("".to_string(), FileEvent::NoEvent), } } @@ -103,6 +110,7 @@ pub fn get_file_change_description_from_file_paths( "{}{} ⟶ {}", format_label(match file_event { FileEvent::Rename => &config.file_renamed_label, + FileEvent::Copy => &config.file_copied_label, _ => "", }), format_file(minus_file), |