summaryrefslogtreecommitdiff
path: root/Git/RefLog.hs
diff options
context:
space:
mode:
authorRichard Hartmann <richih@debian.org>2015-12-16 07:23:53 +0100
committerRichard Hartmann <richih@debian.org>2015-12-16 07:23:53 +0100
commit53679fdc47d9470c2540fbe38d5de38c91c3bb01 (patch)
treee3151adb4d04e905dbb930b67cdb959fac5ea513 /Git/RefLog.hs
parentc94e89d797b15833875ebeb6adcaa6e130315f8e (diff)
parent259c511a17669d043a573344e59eae9e9956265c (diff)
downloadgit-repair-53679fdc47d9470c2540fbe38d5de38c91c3bb01.tar.gz
Merge tag '1.20151215' into debian
tagging package git-repair version 1.20151215
Diffstat (limited to 'Git/RefLog.hs')
-rw-r--r--Git/RefLog.hs22
1 files changed, 15 insertions, 7 deletions
diff --git a/Git/RefLog.hs b/Git/RefLog.hs
index 98c9d66..57f35e9 100644
--- a/Git/RefLog.hs
+++ b/Git/RefLog.hs
@@ -1,6 +1,6 @@
{- git reflog interface
-
- - Copyright 2013 Joey Hess <joey@kitenet.net>
+ - Copyright 2013 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@@ -14,9 +14,17 @@ import Git.Sha
{- Gets the reflog for a given branch. -}
get :: Branch -> Repo -> IO [Sha]
-get b = mapMaybe extractSha . lines <$$> pipeReadStrict
- [ Param "log"
- , Param "-g"
- , Param "--format=%H"
- , Param (fromRef b)
- ]
+get b = getMulti [b]
+
+{- Gets reflogs for multiple branches. -}
+getMulti :: [Branch] -> Repo -> IO [Sha]
+getMulti bs = get' (map (Param . fromRef) bs)
+
+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"
+ ] ++ ps