File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " pyrepscan"
3- version = " 0.9.0 "
3+ version = " 0.9.1 "
44authors = [
" Gal Ben David <[email protected] >" ]
55edition = " 2018"
66description = " A Git Repository Secrets Scanner written in Rust"
@@ -41,6 +41,7 @@ num_cpus = "1"
4141parking_lot = " 0.11"
4242crossbeam = " 0.8"
4343crossbeam-utils = " 0.8"
44+ percent-encoding = " 2"
4445
4546[dependencies .git2 ]
4647version = " 0.13"
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ strip = true
1414
1515[tool .poetry ]
1616name = " pyrepscan"
17- version = " 0.9.0 "
17+ version = " 0.9.1 "
1818authors = [
" Gal Ben David <[email protected] >" ]
1919description = " A Git Repository Secrets Scanner written in Rust"
2020readme = " README.md"
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ mod git_repository_scanner;
22mod rules_manager;
33
44use parking_lot:: Mutex ;
5+ use percent_encoding:: { utf8_percent_encode, NON_ALPHANUMERIC } ;
56use pyo3:: exceptions;
67use pyo3:: prelude:: * ;
78use pyo3:: types:: PyBytes ;
@@ -242,7 +243,7 @@ impl GitRepositoryScanner {
242243 from_timestamp : Option < i64 > ,
243244 ) -> PyResult < Py < PyAny > > {
244245 let mut repository_full_path = PathBuf :: from ( repository_path) ;
245- repository_full_path. push ( url . split ( '/' ) . last ( ) . unwrap_or ( "" ) ) ;
246+ repository_full_path. push ( utf8_percent_encode ( url , NON_ALPHANUMERIC ) . to_string ( ) ) ;
246247
247248 let mut builder = git2:: build:: RepoBuilder :: new ( ) ;
248249 builder. bare ( true ) ;
@@ -253,7 +254,7 @@ impl GitRepositoryScanner {
253254 let matches = Arc :: new ( Mutex :: new ( Vec :: < HashMap < & str , String > > :: with_capacity ( 10000 ) ) ) ;
254255 match git_repository_scanner:: scan_repository (
255256 & py,
256- repository_path ,
257+ & repository_full_path . to_string_lossy ( ) ,
257258 branch_glob_pattern. unwrap_or ( "*" ) ,
258259 from_timestamp. unwrap_or ( 0 ) ,
259260 & self . rules_manager ,
You can’t perform that action at this time.
0 commit comments