Skip to content

Commit

Permalink
Revert "fixup! Get metadata from inner stat metadata"
Browse files Browse the repository at this point in the history
This reverts commit e0ba44f.

Reverted since we use the error behavior
  • Loading branch information
erickguan committed Oct 27, 2024
1 parent e0ba44f commit a0d712e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions core/src/layers/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,7 @@ impl<A: Access> CompleteAccessor<A> {

if path == "/" {
let meta = if capability.stat {
if let Ok(result) = self.inner.stat(path, args).await {
result.into_metadata()
} else {
Metadata::new(EntryMode::DIR)
}
self.inner.stat(path, args).await?.into_metadata()
} else {
Metadata::new(EntryMode::DIR)
};
Expand All @@ -188,11 +184,7 @@ impl<A: Access> CompleteAccessor<A> {

// Forward to inner if create_dir is supported.
if path.ends_with('/') && capability.create_dir {
let meta = if let Ok(result) = self.inner.stat(path, args).await {
result.into_metadata()
} else {
Metadata::new(EntryMode::DIR)
};
let meta = self.inner.stat(path, args).await?.into_metadata();

if meta.is_file() {
return Err(Error::new(
Expand Down

0 comments on commit a0d712e

Please sign in to comment.