mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-11-21 02:20:44 +08:00
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:
@@ -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.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user