@@ -2,12 +2,11 @@ mod git_repository_scanner;
22mod rules_manager;
33
44use parking_lot:: Mutex ;
5- use percent_encoding:: { utf8_percent_encode, NON_ALPHANUMERIC } ;
65use pyo3:: exceptions;
76use pyo3:: prelude:: * ;
87use pyo3:: types:: PyBytes ;
98use std:: collections:: HashMap ;
10- use std:: path:: PathBuf ;
9+ use std:: path:: Path ;
1110use std:: sync:: Arc ;
1211
1312/// GitRepositoryScanner class
@@ -242,19 +241,16 @@ impl GitRepositoryScanner {
242241 branch_glob_pattern : Option < & str > ,
243242 from_timestamp : Option < i64 > ,
244243 ) -> PyResult < Py < PyAny > > {
245- let mut repository_full_path = PathBuf :: from ( repository_path) ;
246- repository_full_path. push ( utf8_percent_encode ( url, NON_ALPHANUMERIC ) . to_string ( ) ) ;
247-
248244 let mut builder = git2:: build:: RepoBuilder :: new ( ) ;
249245 builder. bare ( true ) ;
250- if let Err ( error) = builder. clone ( url, repository_full_path . as_path ( ) ) {
246+ if let Err ( error) = builder. clone ( url, Path :: new ( repository_path ) . as_ref ( ) ) {
251247 return Err ( exceptions:: PyRuntimeError :: new_err ( error. to_string ( ) ) ) ;
252248 } ;
253249
254250 let matches = Arc :: new ( Mutex :: new ( Vec :: < HashMap < & str , String > > :: with_capacity ( 10000 ) ) ) ;
255251 match git_repository_scanner:: scan_repository (
256252 & py,
257- & repository_full_path . to_string_lossy ( ) ,
253+ repository_path ,
258254 branch_glob_pattern. unwrap_or ( "*" ) ,
259255 from_timestamp. unwrap_or ( 0 ) ,
260256 & self . rules_manager ,
0 commit comments