summaryrefslogtreecommitdiff
path: root/Command/Log.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-18 00:45:22 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-20 16:21:43 -0400
commit7c5d445f32a3ecc583d1031f0d01606ffaea9f59 (patch)
tree9dcec016b1ef93d96e293e43f5a5780123bfb059 /Command/Log.hs
parentff6df3c4eb4339ecf9905f7f7c97c5ab04f324bb (diff)
remove some more !!
Diffstat (limited to 'Command/Log.hs')
-rw-r--r--Command/Log.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Command/Log.hs b/Command/Log.hs
index 09d22b2ef..90d3d9490 100644
--- a/Command/Log.hs
+++ b/Command/Log.hs
@@ -159,11 +159,10 @@ readLog = mapMaybe (parse . lines)
-- Parses something like ":100644 100644 oldsha newsha M"
parseRaw :: String -> (Git.Ref, Git.Ref)
-parseRaw l = (Git.Ref oldsha, Git.Ref newsha)
+parseRaw l = go $ words l
where
- ws = words l
- oldsha = ws !! 2
- newsha = ws !! 3
+ go (_:_:oldsha:newsha:_) = (Git.Ref oldsha, Git.Ref newsha)
+ go _ = error $ "unable to parse git log output: " ++ l
parseTimeStamp :: String -> POSIXTime
parseTimeStamp = utcTimeToPOSIXSeconds . fromMaybe (error "bad timestamp") .