Skip to content

Commit

Permalink
fix(integrations/cloud_filter): use explicit stat instead of `Entry…
Browse files Browse the repository at this point in the history
…::metadata` in `fetch_placeholders` (#5416)

* fix: use explicit `stat` instead of `Entry::metadata` in `fetch_placeholders`

* fix: clippy
  • Loading branch information
ho-229 authored Dec 15, 2024
1 parent 60281a0 commit 2ec0aff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion integrations/cloud_filter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl Filter for CloudFilter {
})?
.filter_map(|e| async {
let entry = e.ok()?;
let metadata = entry.metadata();
let metadata = self.op.stat(entry.path()).await.ok()?;
let entry_remote_path = PathBuf::from(entry.path());
let relative_path = entry_remote_path
.strip_prefix(&remote_path)
Expand Down
4 changes: 2 additions & 2 deletions integrations/cloud_filter/tests/behavior/fetch_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ pub fn test_fetch_data() -> Result<(), Failed> {

assert_eq!(
expected_content,
file_content(&path).expect("file hash"),
"file hash",
file_content(&path).expect("file content"),
"file content",
)
}
Ok(())
Expand Down
3 changes: 2 additions & 1 deletion integrations/cloud_filter/tests/behavior/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ pub fn file_content(path: impl Display) -> anyhow::Result<String> {
let content = powershell_script::run(&format!("Get-Content \"{path}\""))
.context("run powershell")?
.stdout()
.unwrap_or_default();
.unwrap_or_default()
.replace("\r\n", "\n"); // powershell returns CRLF, but the fixtures use LF
Ok(content)
}

Expand Down

0 comments on commit 2ec0aff

Please sign in to comment.