sync: Commit in direct mode even if no changes were staged

There may be already staged changes from a prior `git annex add`,
so always commit.

Also, suppressed the commit output, since it contains noise due to
typechanged files in direct mode.
This commit is contained in:
Joey Hess 2013-04-23 17:02:37 -04:00
parent fa9d37fab7
commit 16503f5692

View file

@ -80,8 +80,9 @@ syncRemotes rs = ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted )
commit :: CommandStart
commit = next $ next $ do
ifM isDirect
( ifM stageDirect
( runcommit [] , return True )
( do
void $ stageDirect
runcommit []
, runcommit [Param "-a"]
)
where
@ -90,8 +91,9 @@ commit = next $ next $ do
showOutput
Annex.Branch.commit "update"
-- Commit will fail when the tree is clean, so ignore failure.
_ <- inRepo $ Git.Command.runBool $ (Param "commit") : ps ++
let params = (Param "commit") : ps ++
[Param "-m", Param "git-annex automatic sync"]
_ <- inRepo $ tryIO . Git.Command.runQuiet params
return True
mergeLocal :: Git.Ref -> CommandStart