summaryrefslogtreecommitdiff
path: root/src/Propellor/Git.hs
diff options
context:
space:
mode:
authorJoey Hess2018-01-04 14:48:26 -0400
committerJoey Hess2018-01-04 14:48:26 -0400
commitadc4e56b4e745bf93b17537a777f60e3113a878c (patch)
treefb5e0a218f66466d113c3a0483591e2ccb8553ea /src/Propellor/Git.hs
parent8fd00d35f6d6691da6fabd37d1f3a88d588239d3 (diff)
skip update warning when there's a remote named "upstream"
Diffstat (limited to 'src/Propellor/Git.hs')
-rw-r--r--src/Propellor/Git.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs
index 1d81c157..10b88ddd 100644
--- a/src/Propellor/Git.hs
+++ b/src/Propellor/Git.hs
@@ -23,9 +23,12 @@ getCurrentGitSha1 branchref = takeWhile (/= '\n')
<$> readProcess "git" ["show-ref", "--hash", branchref]
hasOrigin :: IO Bool
-hasOrigin = catchDefaultIO False $ do
+hasOrigin = hasRemote "origin"
+
+hasRemote :: String -> IO Bool
+hasRemote remotename = catchDefaultIO False $ do
rs <- lines <$> readProcess "git" ["remote"]
- return $ "origin" `elem` rs
+ return $ remotename `elem` rs
hasGitRepo :: IO Bool
hasGitRepo = doesFileExist ".git/HEAD"