Open alexlarsson opened 8 years ago
Yes, although I regret having the silent file copy fallback now. It's silently losing all of the advantages of ostree when one does this.
(Why are you doing it?)
I'm using this (mismatched modes) to explicitly get a copy when using ostree for the build-cache. I.e. I check out a copy.
Long term i want to check out a hardlinked copy and use something like fuse-rofiles, but thats not there yet.
Indeed, using fuse-rofiles is the better thing now, at least until we get O_OBJECT or similar.
It sounds like there should be ostree checkout --copy
in case the hardlinking is not desired. It would be even more useful if it used reflinks on BTRFS.
All mtimes for file objects in bare and bare-user repos are stored with mtime == 0. This means when you check them out with matching mode (i.e. -U with bare-user, nothing with bare) then we hardlink and the checked out file has mtime 0.
However if the modes don't match, or the repo is archive-z2, then we copy the files on checkout, and this does not zero the mtime (although the code explicitly sets mtime 0 on directories, so this only applies to files).
This should be fixed by zeroing the mtime in the copy case too.