fix: skip local PathExists check when target is remote (SFTP copy)
This commit is contained in:
parent
7d2a2dd547
commit
c598350fc5
1 changed files with 13 additions and 10 deletions
|
|
@ -2358,17 +2358,20 @@ func (m *Model) handleTransfer(kind fileOpKind) (tea.Model, tea.Cmd) {
|
||||||
kind, m.active, srcPane.Path, dstPane.Path, srcHasRemote, dstHasRemote, sources)
|
kind, m.active, srcPane.Path, dstPane.Path, srcHasRemote, dstHasRemote, sources)
|
||||||
|
|
||||||
// Check for existing targets (fast — one Stat per top-level item)
|
// Check for existing targets (fast — one Stat per top-level item)
|
||||||
|
// Skip when target is remote — local fs check doesn't apply.
|
||||||
existingTargets := 0
|
existingTargets := 0
|
||||||
for _, sourcePath := range sources {
|
if !dstHasRemote {
|
||||||
targetPath := filepath.Join(targetDir, filepath.Base(sourcePath))
|
for _, sourcePath := range sources {
|
||||||
exists, err := vfs.PathExists(targetPath)
|
targetPath := filepath.Join(targetDir, filepath.Base(sourcePath))
|
||||||
if err != nil {
|
exists, err := vfs.PathExists(targetPath)
|
||||||
log.Printf("[ERROR] Transfer: path check failed: %s err=%v", targetPath, err)
|
if err != nil {
|
||||||
m.status = err.Error()
|
log.Printf("[ERROR] Transfer: path check failed: %s err=%v", targetPath, err)
|
||||||
return m, nil
|
m.status = err.Error()
|
||||||
}
|
return m, nil
|
||||||
if exists {
|
}
|
||||||
existingTargets++
|
if exists {
|
||||||
|
existingTargets++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
overwrite := existingTargets > 0
|
overwrite := existingTargets > 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue