avoid partial head function
(although it was used safely)
This commit is contained in:
parent
111b6937ec
commit
eb132a854e
1 changed files with 2 additions and 8 deletions
|
@ -5,14 +5,8 @@
|
||||||
- Licensed under the GNU GPL version 3 or higher.
|
- Licensed under the GNU GPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
module Git.Config (
|
module Git.Config where
|
||||||
get,
|
|
||||||
read,
|
|
||||||
hRead,
|
|
||||||
store
|
|
||||||
) where
|
|
||||||
|
|
||||||
import Prelude hiding (read)
|
|
||||||
import System.Posix.Directory
|
import System.Posix.Directory
|
||||||
import Control.Exception (bracket_)
|
import Control.Exception (bracket_)
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
|
@ -58,7 +52,7 @@ parse :: String -> M.Map String String
|
||||||
parse [] = M.empty
|
parse [] = M.empty
|
||||||
parse s
|
parse s
|
||||||
-- --list output will have an = in the first line
|
-- --list output will have an = in the first line
|
||||||
| '=' `elem` head ls = sep '=' ls
|
| all ('=' `elem`) (take 1 ls) = sep '=' ls
|
||||||
-- --null --list output separates keys from values with newlines
|
-- --null --list output separates keys from values with newlines
|
||||||
| otherwise = sep '\n' $ split "\0" s
|
| otherwise = sep '\n' $ split "\0" s
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in a new issue