fix history path filter for empty path

- add script to update git-platinum
- use Rust 1.66.1 for lint to postpone the move to 1.67.

Signed-off-by: Han Xu <keepsimple@gmail.com>
This commit is contained in:
Han Xu
2023-01-24 20:26:58 -08:00
parent da2b58b867
commit 755124dab3
6 changed files with 78 additions and 12 deletions
+6 -3
View File
@@ -86,9 +86,12 @@ impl<'a> Iterator for History<'a> {
// Handles the optional filter_by.
if let Some(FilterBy::File { path }) = &self.filter_by {
let path_opt = self.repo.diff_commit_and_parents(path, &commit)?;
if path_opt.is_none() {
return Ok(None); // Filter out this commit.
// Only check the commit diff if the path is not empty.
if !path.as_os_str().is_empty() {
let path_opt = self.repo.diff_commit_and_parents(path, &commit)?;
if path_opt.is_none() {
return Ok(None); // Filter out this commit.
}
}
}