This commit is contained in:
Joey Hess 2015-12-26 15:09:47 -04:00
parent 289a3592c3
commit 7593917147
Failed to extract signature

View file

@ -31,7 +31,6 @@ import Logs.View
import Utility.Glob import Utility.Glob
import Utility.FileMode import Utility.FileMode
import Types.Command import Types.Command
import Config
import CmdLine.Action import CmdLine.Action
import qualified Data.Set as S import qualified Data.Set as S
@ -385,10 +384,9 @@ applyView' mkviewedfile getfilemetadata view = do
-} -}
withViewChanges :: (ViewedFile -> Key -> CommandStart) -> (ViewedFile -> Key -> CommandStart) -> Annex () withViewChanges :: (ViewedFile -> Key -> CommandStart) -> (ViewedFile -> Key -> CommandStart) -> Annex ()
withViewChanges addmeta removemeta = do withViewChanges addmeta removemeta = do
makeabs <- flip fromTopFilePath <$> gitRepo
(diffs, cleanup) <- inRepo $ DiffTree.diffIndex Git.Ref.headRef (diffs, cleanup) <- inRepo $ DiffTree.diffIndex Git.Ref.headRef
forM_ diffs handleremovals forM_ diffs handleremovals
forM_ diffs (handleadds makeabs) forM_ diffs handleadds
void $ liftIO cleanup void $ liftIO cleanup
where where
handleremovals item handleremovals item
@ -396,7 +394,7 @@ withViewChanges addmeta removemeta = do
handlechange item removemeta handlechange item removemeta
=<< catKey (DiffTree.srcsha item) =<< catKey (DiffTree.srcsha item)
| otherwise = noop | otherwise = noop
handleadds makeabs item handleadds item
| DiffTree.dstsha item /= nullSha = | DiffTree.dstsha item /= nullSha =
handlechange item addmeta handlechange item addmeta
=<< catKey (DiffTree.dstsha item) =<< catKey (DiffTree.dstsha item)