diff options
author | Joey Hess <joey@kitenet.net> | 2013-01-14 11:56:37 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-01-14 11:56:37 -0400 |
commit | b4af18f29de3848b736a24cde2dce34715b970f6 (patch) | |
tree | 70ad65df737d2e21c374ef9ae7b07c5807e75015 /Annex/Direct.hs | |
parent | 5db2552997f3ada4d8ec3bfe4c9eddc75c23740a (diff) |
In direct mode, files with the same key are no longer hardlinked, as that would cause a surprising behavior if modifying one, where the other would also change.
Diffstat (limited to 'Annex/Direct.hs')
-rw-r--r-- | Annex/Direct.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs index 9ef808163..e0d3f9d79 100644 --- a/Annex/Direct.hs +++ b/Annex/Direct.hs @@ -24,6 +24,7 @@ import Backend import Types.KeySource import Annex.Content import Annex.Content.Direct +import Utility.CopyFile {- Uses git ls-files to find files that need to be committed, and stages - them into the index. Returns True if some changes were staged. -} @@ -181,11 +182,11 @@ toDirectGen k f = do liftIO $ replaceFile f $ moveFile loc , return Nothing ) - (loc':_) -> ifM (liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f) - {- Another direct file has the content, so - - hard link to it. -} + (loc':_) -> ifM (liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus loc') + {- Another direct file has the content; copy it. -} ( return $ Just $ do - liftIO $ replaceFile f $ createLink loc' + liftIO $ replaceFile f $ + void . copyFileExternal loc' , return Nothing ) |