Skip to content

Commit 25c2646

Browse files
authored
Merge pull request #1755 from cruessler/shortcut-tree-diffing-minor-cleanups
Prefix variant to disambiguate from continue
2 parents 34096a5 + ec3cdf1 commit 25c2646

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

gix-blame/src/file/function.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ fn tree_diff_at_file_path(
399399
}
400400

401401
fn visit(&mut self, change: gix_diff::tree::visit::Change) -> gix_diff::tree::visit::Action {
402-
use gix_diff::tree::visit::Action::*;
402+
use gix_diff::tree::visit;
403403
use gix_diff::tree::visit::Change::*;
404404

405405
if self.inner.path() == self.interesting_path {
@@ -438,11 +438,9 @@ fn tree_diff_at_file_path(
438438
},
439439
});
440440

441-
// When we return `Cancel`, `gix_diff::tree` will convert this `Cancel` into an
442-
// `Err(...)`. Keep this in mind when using `FindChangeToPath`.
443-
Cancel
441+
visit::Action::Cancel
444442
} else {
445-
Continue
443+
visit::Action::Continue
446444
}
447445
}
448446
}
@@ -452,9 +450,6 @@ fn tree_diff_at_file_path(
452450
stats.trees_diffed += 1;
453451

454452
match result {
455-
// `recorder` cancels the traversal by returning `Cancel` when a change to `file_path` is
456-
// found. `gix_diff::tree` converts `Cancel` into `Err(Cancelled)` which is why we match on
457-
// `Err(Cancelled)` in addition to `Ok`.
458453
Ok(_) | Err(gix_diff::tree::Error::Cancelled) => Ok(recorder.change),
459454
Err(error) => Err(Error::DiffTree(error)),
460455
}

0 commit comments

Comments
 (0)