Skip to content

Commit 1ad89d1

Browse files
author
Gal Ben David
committed
reverted scan_from_url from chosing the repo dir name
1 parent 8339b66 commit 1ad89d1

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyrepscan"
3-
version = "0.9.1"
3+
version = "0.9.2"
44
authors = ["Gal Ben David <[email protected]>"]
55
edition = "2018"
66
description = "A Git Repository Secrets Scanner written in Rust"
@@ -41,7 +41,6 @@ num_cpus = "1"
4141
parking_lot = "0.11"
4242
crossbeam = "0.8"
4343
crossbeam-utils = "0.8"
44-
percent-encoding = "2"
4544

4645
[dependencies.git2]
4746
version = "0.13"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ strip = true
1414

1515
[tool.poetry]
1616
name = "pyrepscan"
17-
version = "0.9.1"
17+
version = "0.9.2"
1818
authors = ["Gal Ben David <[email protected]>"]
1919
description = "A Git Repository Secrets Scanner written in Rust"
2020
readme = "README.md"

src/lib.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ mod git_repository_scanner;
22
mod rules_manager;
33

44
use parking_lot::Mutex;
5-
use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC};
65
use pyo3::exceptions;
76
use pyo3::prelude::*;
87
use pyo3::types::PyBytes;
98
use std::collections::HashMap;
10-
use std::path::PathBuf;
9+
use std::path::Path;
1110
use 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

Comments
 (0)