11use std:: path:: { Path , PathBuf } ;
2+ #[ cfg( test) ]
23use std:: process:: Command ;
34
5+ use bitfun_services_core:: process_manager;
46use tokio:: task:: spawn_blocking;
57
68pub ( crate ) const DEFAULT_AUTO_INDEX_MIN_FILES : usize = 2_000 ;
@@ -99,7 +101,7 @@ fn git_ls_files_indexable_count(
99101 policy : AutoIndexPolicy ,
100102 carried : usize ,
101103) -> Result < usize , String > {
102- let output = Command :: new ( "git" )
104+ let output = process_manager :: create_command ( "git" )
103105 . arg ( "ls-files" )
104106 . args ( selectors)
105107 . arg ( "-z" )
@@ -128,7 +130,7 @@ fn git_ls_files_indexable_count(
128130}
129131
130132fn git_worktree_root ( repo_root : & Path ) -> Result < PathBuf , String > {
131- let output = Command :: new ( "git" )
133+ let output = process_manager :: create_command ( "git" )
132134 . args ( [ "rev-parse" , "--show-toplevel" ] )
133135 . current_dir ( repo_root)
134136 . output ( )
@@ -146,7 +148,7 @@ fn git_worktree_root(repo_root: &Path) -> Result<PathBuf, String> {
146148 }
147149 let worktree_root = dunce:: canonicalize ( root)
148150 . map_err ( |error| format ! ( "cannot canonicalize Git worktree root: {error}" ) ) ?;
149- let head = Command :: new ( "git" )
151+ let head = process_manager :: create_command ( "git" )
150152 . args ( [ "rev-parse" , "--verify" , "HEAD^{commit}" ] )
151153 . current_dir ( & worktree_root)
152154 . output ( )
0 commit comments