Skip to content

Commit

Permalink
Merge pull request #225 from jandubois/clonefile-exdev
Browse files Browse the repository at this point in the history
Fall back to Copyfile when Clonefile detects a cross-device request
  • Loading branch information
AkihiroSuda authored May 20, 2023
2 parents 21eb927 + 7df79f5 commit 25762ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/copy_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

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

Expand Down

0 comments on commit 25762ef

Please sign in to comment.