mercurial/util.py
changeset 47446 09ff5d532a25
parent 47445 d756fc11cfb9
child 47622 bb917eea1605
--- a/mercurial/util.py	Tue Jun 08 02:31:17 2021 +0200
+++ b/mercurial/util.py	Wed Jun 09 15:33:58 2021 +0200
@@ -1917,6 +1917,7 @@
     checkambig=False,
     nb_bytes=None,
     no_hardlink_cb=None,
+    check_fs_hardlink=True,
 ):
     """copy a file, preserving mode and optionally other stat info like
     atime/mtime
@@ -1935,7 +1936,7 @@
         if checkambig:
             oldstat = checkambig and filestat.frompath(dest)
         unlink(dest)
-    if hardlink:
+    if hardlink and check_fs_hardlink:
         # Hardlinks are problematic on CIFS (issue4546), do not allow hardlinks
         # unless we are confident that dest is on a whitelisted filesystem.
         try: