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:
parent
9ef830e9bb
commit
49542757fd
2 changed files with 96 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue