aboutsummaryrefslogtreecommitdiff
path: root/Command/Sync.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-23 17:02:37 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-23 17:14:28 -0400
commit32f77d97001aa52561bc35060027839bbd184972 (patch)
tree27dc19502a13766d90c012d5057f58e8a7478f01 /Command/Sync.hs
parente8e06ddcaabd845207349e397621654db0029bab (diff)
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.
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r--Command/Sync.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 0a8ed7827..066a12a56 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -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