summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Merger.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-06 14:56:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-06 14:56:04 -0400
commita00f1d26bc3f121e49ee3f6ff5f46d7b330161ff (patch)
tree1951e9ca7e482fc67f9c232b0fb22680ee19f5a0 /Assistant/Threads/Merger.hs
parentd11ded822cf68d4f33a886e0f97f95a3781e0dc1 (diff)
display errors when any named thread crashes
Diffstat (limited to 'Assistant/Threads/Merger.hs')
-rw-r--r--Assistant/Threads/Merger.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs
index 0f33b68ed..663ea40ff 100644
--- a/Assistant/Threads/Merger.hs
+++ b/Assistant/Threads/Merger.hs
@@ -22,8 +22,8 @@ thisThread = "Merger"
{- This thread watches for changes to .git/refs/heads/synced/,
- which indicate incoming pushes. It merges those pushes into the
- currently checked out branch. -}
-mergeThread :: ThreadState -> IO ()
-mergeThread st = do
+mergeThread :: ThreadState -> NamedThread
+mergeThread st = thread $ do
g <- runThreadState st $ fromRepo id
let dir = Git.localGitDir g </> "refs" </> "heads" </> "synced"
createDirectoryIfMissing True dir
@@ -34,6 +34,8 @@ mergeThread st = do
}
void $ watchDir dir (const False) hooks id
debug thisThread ["watching", dir]
+ where
+ thread = NamedThread thisThread
type Handler = Git.Repo -> FilePath -> Maybe FileStatus -> IO ()