-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(history): make git-scanner works with coco
- Loading branch information
Showing
2 changed files
with
31 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
use git_scanner::flare::FlareTreeNode; | ||
use git_scanner::git::GitCalculator; | ||
use git_scanner::git_logger::GitLogConfig; | ||
use git_scanner::{file_walker, IndicatorCalculator}; | ||
use std::path::PathBuf; | ||
|
||
pub fn by_path(root: PathBuf) -> FlareTreeNode { | ||
let mut tics: Vec<Box<dyn IndicatorCalculator>> = vec![]; | ||
let calculator = Box::new(GitCalculator::new( | ||
GitLogConfig::default().include_merges(true).since_years(3), | ||
true, | ||
)); | ||
|
||
tics.push(calculator); | ||
|
||
let mut tree = file_walker::walk_directory(&root, &mut tics).unwrap(); | ||
|
||
for tic in tics { | ||
if let Some(metadata) = tic.metadata().unwrap() { | ||
tree.add_data(tic.name() + "_meta", metadata); | ||
} | ||
} | ||
|
||
return tree; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters