diff options
author | Dan Davison <dandavison7@gmail.com> | 2021-04-25 06:27:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-25 06:27:31 -0400 |
commit | 0de020a9300419caffa529738d4c7592c14a25dc (patch) | |
tree | 863efc69fe824a1675c95f81ae56cebb2dfffa15 /src | |
parent | 97671f76b2f61eba85284e63c6275cd29344fb57 (diff) |
Be less strict about when to try relativizing paths (#576)
With this commit, paths are relativized in `git diff --stat` output
Diffstat (limited to 'src')
-rw-r--r-- | src/delta.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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()? |