mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Refactor untracked file collection logic in collect_untracked_files function
- Updated the logic to skip processing directories that start with a dot (.) unless they are in the set of tracked directories. This change improves the efficiency of identifying untracked files by preventing unnecessary directory traversal. - Ensured that the `walk_dir` function is called only for relevant directories, enhancing the overall performance of the file collection process. These modifications aim to optimize the handling of untracked files within the git repository.
This commit is contained in:
parent
8b0665b9cd
commit
7b17d3d55e
1 changed files with 3 additions and 2 deletions
|
|
@ -354,9 +354,10 @@ fn collect_untracked_files(repo: &gix::Repository, untracked: &mut HashSet<PathB
|
|||
|
||||
if let Ok(meta) = entry.metadata() {
|
||||
if meta.is_dir() {
|
||||
if tracked_dirs.contains(rel_str.as_ref() as &str) {
|
||||
walk_dir(base, &path, index, tracked_dirs, untracked);
|
||||
if name.starts_with('.') && !tracked_dirs.contains(rel_str.as_ref() as &str) {
|
||||
continue;
|
||||
}
|
||||
walk_dir(base, &path, index, tracked_dirs, untracked);
|
||||
} else if meta.is_file() {
|
||||
let path_as_bstr: &gix::bstr::BStr = rel_str.as_bytes().as_bstr();
|
||||
let is_tracked = index.entry_by_path(path_as_bstr).is_some();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue