git-annex/Command/Commit.hs
Joey Hess cfd3b16fe1 add section metadata to all commands
Not yet used .. mindless train work.
2013-03-24 18:28:21 -04:00

29 lines
663 B
Haskell

{- git-annex command
-
- Copyright 2012 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.Commit where
import Common.Annex
import Command
import qualified Annex.Branch
import qualified Git
def :: [Command]
def = [command "commit" paramNothing seek
SectionPlumbing "commits any staged changes to the git-annex branch"]
seek :: [CommandSeek]
seek = [withNothing start]
start :: CommandStart
start = next $ next $ do
Annex.Branch.commit "update"
_ <- runhook <=< inRepo $ Git.hookPath "annex-content"
return True
where
runhook (Just hook) = liftIO $ boolSystem hook []
runhook Nothing = return True