summaryrefslogtreecommitdiff
path: root/Command/Unannex.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Unannex.hs')
-rw-r--r--Command/Unannex.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Command/Unannex.hs b/Command/Unannex.hs
index fdf976d3e..9bde19106 100644
--- a/Command/Unannex.hs
+++ b/Command/Unannex.hs
@@ -15,12 +15,14 @@ import Config
import qualified Annex
import Annex.Content
import Annex.Content.Direct
+import Annex.Version
import qualified Git.Command
import qualified Git.Branch
import qualified Git.Ref
import qualified Git.DiffTree as DiffTree
import Utility.CopyFile
import Command.PreCommit (lockPreCommitHook)
+import qualified Database.Keys
cmd :: Command
cmd = withGlobalOptions annexedMatchingOptions $
@@ -32,7 +34,7 @@ seek :: CmdParams -> CommandSeek
seek = wrapUnannex . (withFilesInGit $ whenAnnexed start)
wrapUnannex :: Annex a -> Annex a
-wrapUnannex a = ifM isDirect
+wrapUnannex a = ifM (versionSupportsUnlockedPointers <||> isDirect)
( a
{- Run with the pre-commit hook disabled, to avoid confusing
- behavior if an unannexed file is added back to git as
@@ -85,6 +87,7 @@ performIndirect file key = do
cleanupIndirect :: FilePath -> Key -> CommandCleanup
cleanupIndirect file key = do
+ Database.Keys.removeAssociatedFile key file
src <- calcRepo $ gitAnnexLocation key
ifM (Annex.getState Annex.fast)
( do