summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2021-04-25 06:27:31 -0400
committerGitHub <noreply@github.com>2021-04-25 06:27:31 -0400
commit0de020a9300419caffa529738d4c7592c14a25dc (patch)
tree863efc69fe824a1675c95f81ae56cebb2dfffa15
parent97671f76b2f61eba85284e63c6275cd29344fb57 (diff)
Be less strict about when to try relativizing paths (#576)
With this commit, paths are relativized in `git diff --stat` output
-rw-r--r--src/delta.rs4
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()?