Correctly check existence of target directory in copy_recursive function (#6875)
Fixes https://github.com/zed-industries/zed/issues/6778 Release Notes: - Fixed issue where copy-paste for folders was not working in the project panel ([#6778](https://github.com/zed-industries/zed/issues/6778)).
This commit is contained in:
+1
-1
@@ -1183,7 +1183,7 @@ pub fn copy_recursive<'a>(
|
||||
.await?
|
||||
.ok_or_else(|| anyhow!("path does not exist: {}", source.display()))?;
|
||||
if metadata.is_dir {
|
||||
if !options.overwrite && fs.metadata(target).await.is_ok() {
|
||||
if !options.overwrite && fs.metadata(target).await.is_ok_and(|m| m.is_some()) {
|
||||
if options.ignore_if_exists {
|
||||
return Ok(());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user