Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Put empty string in onlyFields result if field is not present in commit

  • Loading branch information...
commit 95da30b5a4d3083b925401d80ef360a3d0acff27 1 parent 75de273
@dzhus authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/Snap/Snaplet/Redson/Snapless/CRUD.hs
View
7 src/Snap/Snaplet/Redson/Snapless/CRUD.hs
@@ -147,10 +147,11 @@ getOldIndices key findices = do
------------------------------------------------------------------------------
--- | Extract values of named fields from commit.
+-- | Extract values of named fields from commit. If field is not
+-- present in commit, empty string is used for its value instead.
onlyFields :: Commit -> [FieldName] -> [FieldValue]
-onlyFields commit fields =
- catMaybes $ map (flip M.lookup commit) fields
+onlyFields commit names =
+ map (\fieldName -> fromMaybe "" (M.lookup fieldName commit)) names
------------------------------------------------------------------------------
Please sign in to comment.
Something went wrong with that request. Please try again.