summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-19 12:58:53 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-19 12:58:53 -0400
commitd50d89eb6fbe3698d105be2043043468dee9e386 (patch)
treee636d00e9f10bdd96d9f4268947364b6ac030d0f /Assistant
parentc4e85913513b3f7393c47745b5efc3a564bb9fb8 (diff)
support old versions of git that do not have --allow-empty-message
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Threads/Committer.hs19
1 files changed, 12 insertions, 7 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index 61e3a9287..946726c79 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -20,6 +20,7 @@ import qualified Annex
import qualified Annex.Queue
import qualified Git.Command
import qualified Git.HashObject
+import qualified Git.Version
import Git.Types
import qualified Command.Add
import Utility.ThreadScheduler
@@ -74,19 +75,23 @@ commitThread st changechan commitchan transferqueue dstatus = thread $ runEvery
commitStaged :: Annex Bool
commitStaged = do
Annex.Queue.flush
- void $ inRepo $ Git.Command.runBool "commit"
- [ Param "--allow-empty-message"
- , Param "-m", Param ""
- -- Avoid running the usual git-annex pre-commit hook;
- -- watch does the same symlink fixing, and we don't want
- -- to deal with unlocked files in these commits.
+ void $ inRepo $ Git.Command.runBool "commit" $ nomessage
+ [ Param "--quiet"
+ {- Avoid running the usual git-annex pre-commit hook;
+ - watch does the same symlink fixing, and we don't want
+ - to deal with unlocked files in these commits. -}
, Param "--no-verify"
- , Param "--quiet"
]
{- Empty commits may be made if tree changes cancel
- each other out, etc. Git returns nonzero on those, so
- don't propigate out commit failures. -}
return True
+ where
+ nomessage ps
+ | Git.Version.older "1.7.2" = Param "-m"
+ : Param "autocommit" : ps
+ | otherwise = Param "--allow-empty-message"
+ : Param "-m" : Param "" : ps
{- Decide if now is a good time to make a commit.
- Note that the list of change times has an undefined order.