summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorSean Whitton2015-12-06 16:48:48 -0700
committerJoey Hess2015-12-08 11:58:42 -0400
commit0dab06c92cfef9f46d2e99b9207dba97450d5953 (patch)
treecbcda5f0a10ff6e15a4a46bf336f4608b6aa4437 /src/Propellor
parent09085c76d76f708361e3670eb6726671ed1ba845 (diff)
rewrite getRepoUrl with getGitConfigValue
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name> (cherry picked from commit 3d4c34dece4d295a349ac5b24ec1fbbd3e90f668)
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Git.hs9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs
index e11528fa..a2f5aef2 100644
--- a/src/Propellor/Git.hs
+++ b/src/Propellor/Git.hs
@@ -51,16 +51,9 @@ getGitConfigBool key = do
_ -> False
getRepoUrl :: IO (Maybe String)
-getRepoUrl = getM get urls
+getRepoUrl = getM getGitConfigValue urls
where
urls = ["remote.deploy.url", "remote.origin.url"]
- get u = do
- v <- catchMaybeIO $
- takeWhile (/= '\n')
- <$> readProcess "git" ["config", u]
- return $ case v of
- Just url | not (null url) -> Just url
- _ -> Nothing
hasOrigin :: IO Bool
hasOrigin = catchDefaultIO False $ do