resume properly when copying a file to/from a local git remote is interrupted (take 2)
authorJoey Hess <joeyh@joeyh.name>
Mon, 27 Sep 2021 20:03:01 +0000 (16:03 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 27 Sep 2021 20:03:01 +0000 (16:03 -0400)
commitb9aa2ce8d1a11726561b8e43307d69ce3715d54c
treecd9a83fe2dfdb6e0842b7da387583db0ff552aae
parent7ccf6428636ff3bb71d86726b76ea36e9b32e0ee
resume properly when copying a file to/from a local git remote is interrupted (take 2)

This method avoids breaking test_readonly. Just check if the dest file
exists, and avoid CoW probing when it does, so when CoW probing fails,
it can resume where the previous non-CoW copy left off.

If CoW has been probed already to work, delete the dest file
since a CoW copy will presumably work. It seems like it would be almost
as good to just skip CoW copying in this case too, but consider that the
dest file might have started to be copied from some other remote, not
using CoW, but CoW has been probed to work to copy from the current
place.

Sponsored-by: Dartmouth College's Datalad project
Annex/CopyFile.hs
CHANGELOG
Utility/CopyFile.hs