diff options
author | Joey Hess <joey@kitenet.net> | 2013-07-22 17:06:00 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-07-22 17:28:53 -0400 |
commit | 75760de1adfd5772d2b4d9dc744798ed31f727f9 (patch) | |
tree | c06b9fe0539ccf74e79b16911ab43f7d71b824c4 /Command/Uninit.hs | |
parent | 0f3462afc04dbbb575e36434c8dd5733061fd6fd (diff) |
Support unannex and uninit in direct mode.
In direct mode, it's best to whenever possible not move direct mode files
out of the way, and so I made unannex avoid touching the direct mode file at
all.
That actually turns out to be easy, because in direct mode, unlike indirect
mode, the pre-commit hook won't get confused if the unannexed file later
gets added back by git add. So there's no need to commit the unannex right
away; it can be staged for the user to commit later. This also means that
unannex in direct mode is a lot faster than in indirect mode!
Another subtle bit is the bookkeeping that is done when unannexing a direct
mode file. The inode cache needs to be removed so that when uninit runs
getKeysPresent, it doesn't see the cache and think the key is still
present and crash when it's not.
This commit is sponsored by Douglas Butts. Thanks!
Diffstat (limited to 'Command/Uninit.hs')
-rw-r--r-- | Command/Uninit.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Command/Uninit.hs b/Command/Uninit.hs index 5e50c0b3a..a40e28399 100644 --- a/Command/Uninit.hs +++ b/Command/Uninit.hs @@ -18,7 +18,7 @@ import qualified Annex.Branch import Annex.Content def :: [Command] -def = [notDirect $ addCheck check $ command "uninit" paramPaths seek +def = [addCheck check $ command "uninit" paramPaths seek SectionUtility "de-initialize git-annex and clean out repository"] check :: Annex () @@ -104,6 +104,6 @@ removeUnannexed = go [] go c ks , go (k:c) ks ) - enoughlinks f = do + enoughlinks f = catchBoolIO $ do s <- getFileStatus f return $ linkCount s > 1 |