summaryrefslogtreecommitdiff
path: root/src/Propellor/Git.hs
diff options
context:
space:
mode:
authorJoey Hess2018-02-19 12:46:16 -0400
committerJoey Hess2018-02-19 12:46:16 -0400
commit6f18e665ca8d960a77e437d8edec8f3d14169585 (patch)
treea9a27632955e6a49624565fa8f0d98f5b64872a1 /src/Propellor/Git.hs
parent98dad1f10e92424871f7356469f42481b40256a6 (diff)
Warn again about new upstream version when ~/.propellor was cloned from the Debian git bundle using an older version of propellor that set up an upstream remote.
This commit was sponsored by Jake Vosloo on Patreon.
Diffstat (limited to 'src/Propellor/Git.hs')
-rw-r--r--src/Propellor/Git.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs
index 10b88ddd..c446f67a 100644
--- a/src/Propellor/Git.hs
+++ b/src/Propellor/Git.hs
@@ -30,6 +30,10 @@ hasRemote remotename = catchDefaultIO False $ do
rs <- lines <$> readProcess "git" ["remote"]
return $ remotename `elem` rs
+remoteUrl :: String -> IO (Maybe String)
+remoteUrl remotename = catchDefaultIO Nothing $ headMaybe . lines
+ <$> readProcess "git" ["config", "remote." ++ remotename ++ ".url"]
+
hasGitRepo :: IO Bool
hasGitRepo = doesFileExist ".git/HEAD"