better limiting of start actions to only run whenAnnexed

Mostly only refactoring, but this does remove one redundant stat of the
symlink by copy.
This commit is contained in:
Joey Hess 2011-11-10 23:35:08 -04:00
parent 4389782628
commit b327227ba5
16 changed files with 67 additions and 63 deletions

View file

@ -22,12 +22,12 @@ def =
c n = command n paramPaths seek
seek :: [CommandSeek]
seek = [withFilesInGit start]
seek = [withFilesInGit $ whenAnnexed start]
{- The unlock subcommand replaces the symlink with a copy of the file's
- content. -}
start :: FilePath -> CommandStart
start file = isAnnexed file $ \(key, _) -> do
start :: FilePath -> (Key, Backend Annex) -> CommandStart
start file (key, _) = do
showStart "unlock" file
next $ perform file key