diff options
author | Joey Hess <joey@kitenet.net> | 2011-11-28 15:26:27 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-11-28 16:17:55 -0400 |
commit | 6869e6023e21698038da7e4a858cbaf6f7b7bbed (patch) | |
tree | d6ae8aecbc2b8f65b36f3e0e1dba740d1308bb2e /Command/Add.hs | |
parent | ff2d9c828379ce29e5feb6ac770996be04ac072f (diff) |
support .git/annex on a different disk than the rest of the repo
The only fully supported thing is to have the main repository on one disk,
and .git/annex on another. Only commands that move data in/out of the annex
will need to copy it across devices.
There is only partial support for putting arbitrary subdirectories of
.git/annex on different devices. For one thing, but this can require more
copies to be done. For example, when .git/annex/tmp is on one device, and
.git/annex/journal on another, every journal write involves a call to
mv(1). Also, there are a few places that make hard links between various
subdirectories of .git/annex with createLink, that are not handled.
In the common case without cross-device, the new moveFile is actually
faster than renameFile, avoiding an unncessary stat to check that a file
(not a directory) is being moved. Of course if a cross-device move is
needed, it is as slow as mv(1) of the data.
Diffstat (limited to 'Command/Add.hs')
-rw-r--r-- | Command/Add.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Command/Add.hs b/Command/Add.hs index ab104b53c..130f5e311 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -61,7 +61,7 @@ undo file key e = do tryharder :: IOException -> Annex () tryharder _ = do src <- fromRepo $ gitAnnexLocation key - liftIO $ renameFile src file + liftIO $ moveFile src file cleanup :: FilePath -> Key -> Bool -> CommandCleanup cleanup file key hascontent = do |