summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-02-11 13:33:55 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-02-11 13:34:05 -0400
commit0dfcca521027baef75953b644aaf71dc58bec80b (patch)
treec358277a63208281bd2df177de62b28af81da5af /Assistant
parentff9fa516cdcf529e079e48b183c213a393c1a128 (diff)
sync, assistant: Include repository name in head branch commit message.
Note that while the assistant detects changes made to remote names, I left the commit message fixed rather than calculating it after every commit. It doesn't seem worth the CPU to do the latter.
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Threads/Committer.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index 3f8debdc2..8cf6da2d2 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -50,6 +50,7 @@ commitThread = namedThread "Committer" $ do
delayadd <- liftAnnex $
maybe delayaddDefault (return . Just . Seconds)
=<< annexDelayAdd <$> Annex.getGitConfig
+ msg <- liftAnnex Command.Sync.commitMsg
waitChangeTime $ \(changes, time) -> do
readychanges <- handleAdds havelsof delayadd changes
if shouldCommit False time (length readychanges) readychanges
@@ -60,7 +61,7 @@ commitThread = namedThread "Committer" $ do
, "changes"
]
void $ alertWhile commitAlert $
- liftAnnex commitStaged
+ liftAnnex $ commitStaged msg
recordCommit
let numchanges = length readychanges
mapM_ checkChangeContent readychanges
@@ -212,15 +213,15 @@ shouldCommit scanning now len changes
recentchanges = filter thissecond changes
timeDelta c = now `diffUTCTime` changeTime c
-commitStaged :: Annex Bool
-commitStaged = do
+commitStaged :: String -> Annex Bool
+commitStaged msg = do
{- This could fail if there's another commit being made by
- something else. -}
v <- tryNonAsync Annex.Queue.flush
case v of
Left _ -> return False
Right _ -> do
- ok <- Command.Sync.commitStaged Git.Branch.AutomaticCommit ""
+ ok <- Command.Sync.commitStaged Git.Branch.AutomaticCommit msg
when ok $
Command.Sync.updateSyncBranch =<< inRepo Git.Branch.current
return ok