in v6 mode, unannex does not interact badly with pre-commit hook
authorJoey Hess <joeyh@joeyh.name>
Tue, 15 Dec 2015 20:18:39 +0000 (16:18 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 15 Dec 2015 20:18:39 +0000 (16:18 -0400)
So can be used in a tree with staged changes, no problems. Much nicer.

Command/Unannex.hs

index fdf976d3e08a3ebf84538ccf91db1790c5c134eb..f7af8cde6301cea2e98a5445c06d574ee057537f 100644 (file)
@@ -15,6 +15,7 @@ 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
@@ -32,7 +33,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