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