minor
This commit is contained in:
parent
cd1e39b127
commit
16b551726d
1 changed files with 3 additions and 2 deletions
|
@ -112,10 +112,11 @@ gitConfigRead repo = do
|
||||||
c <- gitPipeRead repo ["config", "--list"]
|
c <- gitPipeRead repo ["config", "--list"]
|
||||||
return repo { config = Map.fromList $ parse c }
|
return repo { config = Map.fromList $ parse c }
|
||||||
where
|
where
|
||||||
parse s = map ( \l -> (key l, val l) ) $ lines s
|
parse s = map pair $ lines s
|
||||||
keyval l = split sep l :: [String]
|
pair l = (key l, val l)
|
||||||
key l = (keyval l) !! 0
|
key l = (keyval l) !! 0
|
||||||
val l = join sep $ drop 1 $ keyval l
|
val l = join sep $ drop 1 $ keyval l
|
||||||
|
keyval l = split sep l :: [String]
|
||||||
sep = "="
|
sep = "="
|
||||||
|
|
||||||
{- Returns a single git config setting, or a default value if not set. -}
|
{- Returns a single git config setting, or a default value if not set. -}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue