summaryrefslogtreecommitdiff
path: root/Command/Uninit.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-28 16:56:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-28 16:56:01 -0400
commit39163cb024b49a0214c104d4fe21b778bbd63eaa (patch)
treed6ff5978d5cac09dac14231a5d423a6784102dfa /Command/Uninit.hs
parentd93d453c3c4d41d446970db21b1d504b3690adb6 (diff)
unannex: New, much slower, but more safe behavior
Copies files out of the annex. This avoids an unannex of one file breaking other files that link to the same content. Also, it means that the content remains in the annex using up space until cleaned up with "git annex unused". (The behavior of unannex --fast has not changed; it still hard links to content in the annex. --fast was not made the default because it is potentially unsafe; editing such a hard linked file can unexpectedly change content stored in the annex.)
Diffstat (limited to 'Command/Uninit.hs')
-rw-r--r--Command/Uninit.hs10
1 files changed, 1 insertions, 9 deletions
diff --git a/Command/Uninit.hs b/Command/Uninit.hs
index a40e28399..f017d196e 100644
--- a/Command/Uninit.hs
+++ b/Command/Uninit.hs
@@ -38,7 +38,7 @@ check = do
seek :: [CommandSeek]
seek =
[ withFilesNotInGit $ whenAnnexed startCheckIncomplete
- , withFilesInGit $ whenAnnexed startUnannex
+ , withFilesInGit $ whenAnnexed Command.Unannex.start
, withNothing start
]
@@ -51,14 +51,6 @@ startCheckIncomplete file _ = error $ unlines
, "Not continuing with uninit; either delete or git annex add the file and retry."
]
-startUnannex :: FilePath -> (Key, Backend) -> CommandStart
-startUnannex file info = do
- -- Force fast mode before running unannex. This way, if multiple
- -- files link to a key, it will be left in the annex and hardlinked
- -- to by each.
- Annex.changeState $ \s -> s { Annex.fast = True }
- Command.Unannex.start file info
-
start :: CommandStart
start = next $ next $ do
annexdir <- fromRepo gitAnnexDir