Skip to content

Commit 7df79f5

Browse files
committed
Fall back to Copyfile when Clonefile detects a cross-device request
Signed-off-by: Jan Dubois <[email protected]>
1 parent 21eb927 commit 7df79f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/copy_darwin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
func copyFile(target, source string) error {
2727
if err := unix.Clonefile(source, target, unix.CLONE_NOFOLLOW); err != nil {
28-
if !errors.Is(err, unix.ENOTSUP) {
28+
if !errors.Is(err, unix.ENOTSUP) && !errors.Is(err, unix.EXDEV) {
2929
return fmt.Errorf("clonefile failed: %w", err)
3030
}
3131

0 commit comments

Comments
 (0)