summaryrefslogtreecommitdiff
path: root/Git/RefLog.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-07 17:31:30 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-07 17:36:30 -0400
commitb68b110dda6db2917a418b24ce7372aca6307fd1 (patch)
tree1c210a9738a23bff3b25a72fd8a7c738215446a8 /Git/RefLog.hs
parent1acc9824905411220c0fa1921ab2456a52e6b491 (diff)
Only look at reflogs for relevant branches, not for git-annex branches
This speeds it up quite a bit.. May still be too slow in large repos.
Diffstat (limited to 'Git/RefLog.hs')
-rw-r--r--Git/RefLog.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Git/RefLog.hs b/Git/RefLog.hs
index 940bb10a1..57f35e918 100644
--- a/Git/RefLog.hs
+++ b/Git/RefLog.hs
@@ -14,18 +14,17 @@ import Git.Sha
{- Gets the reflog for a given branch. -}
get :: Branch -> Repo -> IO [Sha]
-get b = get' [] (Just b)
+get b = getMulti [b]
-{- Gets all reflogs for all branches. -}
-getAll :: Repo -> IO [Sha]
-getAll = get' [Param "--all"] Nothing
+{- Gets reflogs for multiple branches. -}
+getMulti :: [Branch] -> Repo -> IO [Sha]
+getMulti bs = get' (map (Param . fromRef) bs)
-get' :: [CommandParam] -> Maybe Branch -> Repo -> IO [Sha]
-get' ps b = mapMaybe extractSha . lines <$$> pipeReadStrict ps'
+get' :: [CommandParam] -> Repo -> IO [Sha]
+get' ps = mapMaybe extractSha . lines <$$> pipeReadStrict ps'
where
ps' = catMaybes
[ Just $ Param "log"
, Just $ Param "-g"
, Just $ Param "--format=%H"
- , Param . fromRef <$> b
] ++ ps