git-annex/Command/Merge.hs
Joey Hess 1f73db3469 improve alwayscommit=false mode
Now changes are staged into the branch's index, but not committed,
which avoids growing a large journal. And sync and merge always
explicitly commit, ensuring that even when they do nothing else,
they commit the staged changes.

Added a flag file to indicate that the branch's journal contains
uncommitted changes. (Could use git ls-files, but don't want to run
that every time.)

In the future, this ability to have uncommitted changes staged in the
journal might be used on remotes after a series of oneshot commands.
2012-02-25 16:18:55 -04:00

31 lines
629 B
Haskell

{- git-annex command
-
- Copyright 2011 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.Merge where
import Common.Annex
import Command
import qualified Annex.Branch
def :: [Command]
def = [command "merge" paramNothing seek
"auto-merge remote changes into git-annex branch"]
seek :: [CommandSeek]
seek = [withNothing start]
start :: CommandStart
start = do
showStart "merge" "."
next perform
perform :: CommandPerform
perform = do
Annex.Branch.update
-- commit explicitly, in case no remote branches were merged
Annex.Branch.commit "update"
next $ return True