summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/ReKey.hs13
-rw-r--r--doc/design/assistant/android.mdwn1
2 files changed, 11 insertions, 3 deletions
diff --git a/Command/ReKey.hs b/Command/ReKey.hs
index df878a581..54a345dcb 100644
--- a/Command/ReKey.hs
+++ b/Command/ReKey.hs
@@ -14,6 +14,8 @@ import Types.Key
import Annex.Content
import qualified Command.Add
import Logs.Web
+import Config
+import Utility.CopyFile
def :: [Command]
def = [notDirect $ command "rekey"
@@ -48,8 +50,15 @@ perform file oldkey newkey = do
linkKey :: Key -> Key -> Annex Bool
linkKey oldkey newkey = getViaTmpUnchecked newkey $ \tmp -> do
src <- inRepo $ gitAnnexLocation oldkey
- liftIO $ unlessM (doesFileExist tmp) $ createLink src tmp
- return True
+ ifM (liftIO $ doesFileExist tmp)
+ ( return True
+ , ifM crippledFileSystem
+ ( liftIO $ copyFileExternal src tmp
+ , do
+ liftIO $ createLink src tmp
+ return True
+ )
+ )
cleanup :: FilePath -> Key -> Key -> CommandCleanup
cleanup file oldkey newkey = do
diff --git a/doc/design/assistant/android.mdwn b/doc/design/assistant/android.mdwn
index ff391e301..010380635 100644
--- a/doc/design/assistant/android.mdwn
+++ b/doc/design/assistant/android.mdwn
@@ -22,5 +22,4 @@ file modes, etc.
## TODO
-* migrate creates hard links between old and new keys
* avoid all symlink creation in crippled filesystem + direct mode