diff --git a/src/git_ops/git2_ops.rs b/src/git_ops/git2_ops.rs index ac9c95a..bf68695 100644 --- a/src/git_ops/git2_ops.rs +++ b/src/git_ops/git2_ops.rs @@ -702,8 +702,9 @@ impl GitOperations for Git2Operations { })?; let patterns = content .lines() - .map(|line| line.trim().to_string()) + .map(|line| line.trim()) .filter(|line| !line.is_empty() && !line.starts_with('#')) + .map(|line| line.to_string()) .collect(); Ok(patterns) } diff --git a/src/git_ops/simple_gix.rs b/src/git_ops/simple_gix.rs index 7679ab4..95bf3bb 100644 --- a/src/git_ops/simple_gix.rs +++ b/src/git_ops/simple_gix.rs @@ -111,4 +111,3 @@ pub fn fetch_repo(repo: gix::Repository, remote: Option, shallow: bool) } }) } - diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index b05c40f..38959e5 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -788,7 +788,8 @@ active = true .output() .expect("Failed to run git"); - let is_shallow = String::from_utf8_lossy(&output.stdout).trim(); + let output_str = String::from_utf8_lossy(&output.stdout); + let is_shallow = output_str.trim(); assert_eq!( is_shallow, "true", "Repository at lib/shallow should be shallow"