File tree 3 files changed +6
-4
lines changed
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " pyrepscan"
3
- version = " 0.9.0 "
3
+ version = " 0.9.1 "
4
4
authors = [" Gal Ben David <gal@intsights.com>" ]
5
5
edition = " 2018"
6
6
description = " A Git Repository Secrets Scanner written in Rust"
@@ -41,6 +41,7 @@ num_cpus = "1"
41
41
parking_lot = " 0.11"
42
42
crossbeam = " 0.8"
43
43
crossbeam-utils = " 0.8"
44
+ percent-encoding = " 2"
44
45
45
46
[dependencies .git2 ]
46
47
version = " 0.13"
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ strip = true
14
14
15
15
[tool .poetry ]
16
16
name = " pyrepscan"
17
- version = " 0.9.0 "
17
+ version = " 0.9.1 "
18
18
authors = [" Gal Ben David <gal@intsights.com>" ]
19
19
description = " A Git Repository Secrets Scanner written in Rust"
20
20
readme = " README.md"
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ mod git_repository_scanner;
2
2
mod rules_manager;
3
3
4
4
use parking_lot:: Mutex ;
5
+ use percent_encoding:: { utf8_percent_encode, NON_ALPHANUMERIC } ;
5
6
use pyo3:: exceptions;
6
7
use pyo3:: prelude:: * ;
7
8
use pyo3:: types:: PyBytes ;
@@ -242,7 +243,7 @@ impl GitRepositoryScanner {
242
243
from_timestamp : Option < i64 > ,
243
244
) -> PyResult < Py < PyAny > > {
244
245
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 ( ) ) ;
246
247
247
248
let mut builder = git2:: build:: RepoBuilder :: new ( ) ;
248
249
builder. bare ( true ) ;
@@ -253,7 +254,7 @@ impl GitRepositoryScanner {
253
254
let matches = Arc :: new ( Mutex :: new ( Vec :: < HashMap < & str , String > > :: with_capacity ( 10000 ) ) ) ;
254
255
match git_repository_scanner:: scan_repository (
255
256
& py,
256
- repository_path ,
257
+ & repository_full_path . to_string_lossy ( ) ,
257
258
branch_glob_pattern. unwrap_or ( "*" ) ,
258
259
from_timestamp. unwrap_or ( 0 ) ,
259
260
& self . rules_manager ,
You can’t perform that action at this time.
0 commit comments