2011-06-22 22:46:45 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
|
|
|
- Copyright 2011 Joey Hess <joey@kitenet.net>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.Merge where
|
|
|
|
|
2011-10-05 20:02:51 +00:00
|
|
|
import Common.Annex
|
2011-06-22 22:46:45 +00:00
|
|
|
import Command
|
2011-10-04 04:40:47 +00:00
|
|
|
import qualified Annex.Branch
|
2011-06-22 22:46:45 +00:00
|
|
|
|
2011-10-29 19:19:05 +00:00
|
|
|
def :: [Command]
|
2013-03-24 22:28:21 +00:00
|
|
|
def = [command "merge" paramNothing seek SectionMaintenance
|
|
|
|
"auto-merge remote changes into git-annex branch"]
|
2011-06-22 22:46:45 +00:00
|
|
|
|
|
|
|
seek :: [CommandSeek]
|
|
|
|
seek = [withNothing start]
|
|
|
|
|
2011-09-15 20:50:49 +00:00
|
|
|
start :: CommandStart
|
2011-06-22 22:46:45 +00:00
|
|
|
start = do
|
|
|
|
showStart "merge" "."
|
|
|
|
next perform
|
|
|
|
|
|
|
|
perform :: CommandPerform
|
|
|
|
perform = do
|
2011-10-04 04:40:47 +00:00
|
|
|
Annex.Branch.update
|
2012-02-25 20:11:47 +00:00
|
|
|
-- commit explicitly, in case no remote branches were merged
|
|
|
|
Annex.Branch.commit "update"
|
2011-06-22 22:46:45 +00:00
|
|
|
next $ return True
|