2012-02-25 16:31:38 -04:00
|
|
|
{- git-annex command
|
|
|
|
-
|
2015-01-21 12:50:09 -04:00
|
|
|
- Copyright 2012 Joey Hess <id@joeyh.name>
|
2012-02-25 16:31:38 -04:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.Commit where
|
|
|
|
|
|
|
|
import Command
|
|
|
|
import qualified Annex.Branch
|
2012-03-14 12:01:56 -04:00
|
|
|
import qualified Git
|
2012-02-25 16:31:38 -04:00
|
|
|
|
2015-07-08 12:33:27 -04:00
|
|
|
cmd :: Command
|
2015-07-08 15:08:02 -04:00
|
|
|
cmd = command "commit" SectionPlumbing
|
|
|
|
"commits any staged changes to the git-annex branch"
|
|
|
|
paramNothing (withParams seek)
|
2012-02-25 16:31:38 -04:00
|
|
|
|
2015-07-08 12:33:27 -04:00
|
|
|
seek :: CmdParams -> CommandSeek
|
2018-10-01 14:12:06 -04:00
|
|
|
seek = withNothing (commandAction start)
|
2012-02-25 16:31:38 -04:00
|
|
|
|
|
|
|
start :: CommandStart
|
|
|
|
start = next $ next $ do
|
2018-08-02 14:06:06 -04:00
|
|
|
Annex.Branch.commit =<< Annex.Branch.commitMessage
|
2012-06-14 00:01:48 -04:00
|
|
|
_ <- runhook <=< inRepo $ Git.hookPath "annex-content"
|
2012-03-14 12:39:09 -04:00
|
|
|
return True
|
2012-11-12 01:05:04 -04:00
|
|
|
where
|
|
|
|
runhook (Just hook) = liftIO $ boolSystem hook []
|
|
|
|
runhook Nothing = return True
|