aboutsummaryrefslogtreecommitdiff
path: root/Git/Config.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-15 13:05:47 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-15 13:05:47 -0400
commita8643ca44c49cc945f0ecb0e02c2946595415054 (patch)
treeab8349bc00678902bbd76dfbe33d48612d698b75 /Git/Config.hs
parent09cd04277577381464eddceb42558ad300c49378 (diff)
refactor
Diffstat (limited to 'Git/Config.hs')
-rw-r--r--Git/Config.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Git/Config.hs b/Git/Config.hs
index 1fe948499..8d7963994 100644
--- a/Git/Config.hs
+++ b/Git/Config.hs
@@ -58,9 +58,9 @@ parse :: String -> M.Map String String
parse [] = M.empty
parse s
-- --list output will have an = in the first line
- | '=' `elem` head ls = M.fromList $ map (separate (== '=')) ls
+ | '=' `elem` head ls = sep '=' ls
-- --null --list output separates keys from values with newlines
- | otherwise = M.fromList $ map (separate (== '\n')) $ split "\0" s
+ | otherwise = sep '\n' $ split "\0" s
where
- pair = separate (== '=')
ls = lines s
+ sep c = M.fromList . map (separate (== c))