From 0de020a9300419caffa529738d4c7592c14a25dc Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sun, 25 Apr 2021 06:27:31 -0400 Subject: Be less strict about when to try relativizing paths (#576) With this commit, paths are relativized in `git diff --stat` output --- src/delta.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/delta.rs b/src/delta.rs index 26dbc687..e695397e 100644 --- a/src/delta.rs +++ b/src/delta.rs @@ -113,7 +113,9 @@ impl<'a> StateMachine<'a> { let mut handled_line = if line.starts_with("commit ") { self.handle_commit_meta_header_line()? - } else if self.state == State::CommitMeta && line.starts_with(' ') { + } else if (self.state == State::CommitMeta || self.state == State::Unknown) + && line.starts_with(' ') + { self.handle_diff_stat_line()? } else if line.starts_with("diff ") { self.handle_file_meta_diff_line()? -- cgit v1.2.3